diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-12-02 23:24:53 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2017-01-12 01:28:11 +0800 |
commit | 91d4e8e0bab6f5285103af6ef84a7813cfbb61a2 (patch) | |
tree | 87f3a1c7fb668b65dc47fdda0e1ced171f262a04 /libsolidity/analysis/DeclarationContainer.cpp | |
parent | 42b672617392ecb294447f73fd011092cd58702b (diff) | |
download | dexon-solidity-91d4e8e0bab6f5285103af6ef84a7813cfbb61a2.tar.gz dexon-solidity-91d4e8e0bab6f5285103af6ef84a7813cfbb61a2.tar.zst dexon-solidity-91d4e8e0bab6f5285103af6ef84a7813cfbb61a2.zip |
analysis: changes necessary to compile std/StandardToken.sol
Diffstat (limited to 'libsolidity/analysis/DeclarationContainer.cpp')
-rw-r--r-- | libsolidity/analysis/DeclarationContainer.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libsolidity/analysis/DeclarationContainer.cpp b/libsolidity/analysis/DeclarationContainer.cpp index 1599b83a..f8c12c5b 100644 --- a/libsolidity/analysis/DeclarationContainer.cpp +++ b/libsolidity/analysis/DeclarationContainer.cpp @@ -44,10 +44,19 @@ Declaration const* DeclarationContainer::conflictingDeclaration( if (dynamic_cast<FunctionDefinition const*>(&_declaration)) { - // check that all other declarations with the same name are functions + // check that all other declarations with the same name are functions or a public state variable for (Declaration const* declaration: declarations) - if (!dynamic_cast<FunctionDefinition const*>(declaration)) + { + if (dynamic_cast<FunctionDefinition const*>(declaration)) + continue; + if (auto variableDeclaration = dynamic_cast<VariableDeclaration const*>(declaration)) + { + if (variableDeclaration->isStateVariable() && !variableDeclaration->isConstant() && variableDeclaration->isPublic()) + continue; return declaration; + } + return declaration; + } } else if (declarations.size() == 1 && declarations.front() == &_declaration) return nullptr; |