analysis: changes necessary to compile std/StandardToken.sol

This commit is contained in:
Yoichi Hirai committed 2017-01-11 18:28:11 +01:00
1 parent 42b6726173
commit 91d4e8e0ba
3 files changed
+58 -12

No files matched your search

+11 -2
View File
@@ -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;