mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2464 from federicobond/deprecate-function-type-names
Warn deprecated usage of parameter names in function types
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 '_'.
|
||||
|
||||
Reference in New Issue
Block a user