diff options
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/NameAndTypeResolver.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libsolidity/analysis/NameAndTypeResolver.cpp b/libsolidity/analysis/NameAndTypeResolver.cpp index 47a9df1b..08323243 100644 --- a/libsolidity/analysis/NameAndTypeResolver.cpp +++ b/libsolidity/analysis/NameAndTypeResolver.cpp @@ -278,17 +278,10 @@ vector<Declaration const*> NameAndTypeResolver::cleanedDeclarations( uniqueFunctions.end(), [&](Declaration const* d) { - if (FunctionDefinition const* functionDefinition = dynamic_cast<FunctionDefinition const*>(d)) - { - FunctionType const newFunctionType(*functionDefinition); - return functionType->hasEqualArgumentTypes(newFunctionType); - } - else if (VariableDeclaration const* variableDeclaration = dynamic_cast<VariableDeclaration const*>(d)) - { - FunctionType const newFunctionType(*variableDeclaration); - return functionType->hasEqualArgumentTypes(newFunctionType); - } - return false; // to make compiler happy + shared_ptr<FunctionType const> newFunctionType { d->functionType(false) }; + if (!newFunctionType) + newFunctionType = d->functionType(true); + return newFunctionType && functionType->hasEqualArgumentTypes(*newFunctionType); } )) uniqueFunctions.push_back(*it); |