Correctly determine whether base constructor is called without parentheses.

This commit is contained in:
chriseth
2018-08-01 12:28:27 +01:00
committed by Alex Beregszaszi
parent 7e5406dd89
commit 061ea0cfc6
2 changed files with 20 additions and 11 deletions
+11 -11
View File
@@ -286,19 +286,19 @@ void TypeChecker::checkContractBaseConstructorArguments(ContractDefinition const
{
if (FunctionDefinition const* constructor = contract->constructor())
for (auto const& modifier: constructor->modifiers())
{
auto baseContract = dynamic_cast<ContractDefinition const*>(&dereference(*modifier->name()));
if (modifier->arguments())
if (auto baseContract = dynamic_cast<ContractDefinition const*>(&dereference(*modifier->name())))
{
if (baseContract && baseContract->constructor())
annotateBaseConstructorArguments(_contract, baseContract->constructor(), modifier.get());
if (modifier->arguments())
{
if (baseContract->constructor())
annotateBaseConstructorArguments(_contract, baseContract->constructor(), modifier.get());
}
else
m_errorReporter.declarationError(
modifier->location(),
"Modifier-style base constructor call without arguments."
);
}
else
m_errorReporter.declarationError(
modifier->location(),
"Modifier-style base constructor call without arguments."
);
}
for (ASTPointer<InheritanceSpecifier> const& base: contract->baseContracts())
{