Correctly determine whether base constructor is called without parentheses.

This commit is contained in:
chriseth 2018-06-29 00:18:22 +02:00 committed by Alex Beregszaszi
parent 7e5406dd89
commit 061ea0cfc6
2 changed files with 20 additions and 11 deletions

View File

@ -286,11 +286,11 @@ void TypeChecker::checkContractBaseConstructorArguments(ContractDefinition const
{
if (FunctionDefinition const* constructor = contract->constructor())
for (auto const& modifier: constructor->modifiers())
if (auto baseContract = dynamic_cast<ContractDefinition const*>(&dereference(*modifier->name())))
{
auto baseContract = dynamic_cast<ContractDefinition const*>(&dereference(*modifier->name()));
if (modifier->arguments())
{
if (baseContract && baseContract->constructor())
if (baseContract->constructor())
annotateBaseConstructorArguments(_contract, baseContract->constructor(), modifier.get());
}
else

View File

@ -0,0 +1,9 @@
// This generated an invalid warning on m1 in some compiler versions.
contract A {
constructor() m1 public { }
modifier m1 { _; }
}
contract B is A {
modifier m2 { _; }
constructor() A() m1 m2 public { }
}