diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-01-10 23:34:55 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2017-01-12 02:55:55 +0800 |
commit | 7fea4b7360d1db01a33fd2c5a90e966880232e47 (patch) | |
tree | a4e39b7de53ac45178b9aefe17f387f3bdee417d /libsolidity/analysis | |
parent | eda147f47bb5a0dfbed50aa2c2224daebafa76a8 (diff) | |
download | dexon-solidity-7fea4b7360d1db01a33fd2c5a90e966880232e47.tar.gz dexon-solidity-7fea4b7360d1db01a33fd2c5a90e966880232e47.tar.zst dexon-solidity-7fea4b7360d1db01a33fd2c5a90e966880232e47.zip |
analysis: use Declaration::functionType() in another location
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); |