aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2017-06-25 01:09:19 +0800
committerFederico Bond <federicobond@gmail.com>2017-06-27 02:39:01 +0800
commit70fd5c17704119a3f52aba5c67eda96c2a222d2d (patch)
tree2cc6c9255c71f821bed14ed5b2b37ccf1162bbe5 /libsolidity
parentbffb8c404f0df22c4da7cdc2a8affcbb77377582 (diff)
downloaddexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.gz
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.bz2
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.lz
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.xz
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.zst
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.zip
Warn deprecated usage of parameter names in function types
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/SyntaxChecker.cpp12
-rw-r--r--libsolidity/analysis/SyntaxChecker.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp
index 35d71d85..02e2fdcf 100644
--- a/libsolidity/analysis/SyntaxChecker.cpp
+++ b/libsolidity/analysis/SyntaxChecker.cpp
@@ -148,3 +148,15 @@ bool SyntaxChecker::visit(PlaceholderStatement const&)
return true;
}
+bool SyntaxChecker::visit(FunctionTypeName const& _node)
+{
+ for (auto const& decl: _node.parameterTypeList()->parameters())
+ if (!decl->name().empty())
+ m_errorReporter.warning(decl->location(), "Naming function type parameters is deprecated.");
+
+ for (auto const& decl: _node.returnParameterTypeList()->parameters())
+ if (!decl->name().empty())
+ m_errorReporter.warning(decl->location(), "Naming function type return parameters is deprecated.");
+
+ return true;
+}
diff --git a/libsolidity/analysis/SyntaxChecker.h b/libsolidity/analysis/SyntaxChecker.h
index b1857aa5..ec6ac434 100644
--- a/libsolidity/analysis/SyntaxChecker.h
+++ b/libsolidity/analysis/SyntaxChecker.h
@@ -63,6 +63,8 @@ private:
virtual bool visit(PlaceholderStatement const& _placeholderStatement) override;
+ virtual bool visit(FunctionTypeName const& _node) override;
+
ErrorReporter& m_errorReporter;
/// Flag that indicates whether a function modifier actually contains '_'.