Do not exclude public state variables when looking for conflicting declarations.

This commit is contained in:
Daniel Kirchner
2018-08-01 14:31:04 +02:00
parent ce99a5ce7f
commit 30d9961efb
6 changed files with 29 additions and 8 deletions
@@ -49,16 +49,9 @@ Declaration const* DeclarationContainer::conflictingDeclaration(
dynamic_cast<MagicVariableDeclaration const*>(&_declaration)
)
{
// check that all other declarations with the same name are functions or a public state variable or events.
// And then check that the signatures are different.
// check that all other declarations are of the same kind
for (Declaration const* declaration: declarations)
{
if (auto variableDeclaration = dynamic_cast<VariableDeclaration const*>(declaration))
{
if (variableDeclaration->isStateVariable() && !variableDeclaration->isConstant() && variableDeclaration->isPublic())
continue;
return declaration;
}
if (
dynamic_cast<FunctionDefinition const*>(&_declaration) &&
!dynamic_cast<FunctionDefinition const*>(declaration)