aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/DeclarationContainer.cpp
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-12-02 23:24:53 +0800
committerYoichi Hirai <i@yoichihirai.com>2017-01-12 01:28:11 +0800
commit91d4e8e0bab6f5285103af6ef84a7813cfbb61a2 (patch)
tree87f3a1c7fb668b65dc47fdda0e1ced171f262a04 /libsolidity/analysis/DeclarationContainer.cpp
parent42b672617392ecb294447f73fd011092cd58702b (diff)
downloaddexon-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.cpp13
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;