[Sol->Yul] Checking if there is base contract when calling base constructror via modifier invocation.

This commit is contained in:
Djordje Mijovic 2020-05-04 20:38:22 +02:00
parent 1bb07e268b
commit cf607aa887

View File

@ -310,10 +310,14 @@ pair<string, map<ContractDefinition const*, string>> IRGenerator::evaluateConstr
);
if (FunctionDefinition const* constructor = _contract.constructor())
for (auto const& modifier: constructor->modifiers())
if (FunctionDefinition const* baseConstructor = dynamic_cast<ContractDefinition const*>(
for (ASTPointer<ModifierInvocation> const& modifier: constructor->modifiers())
if (auto const* baseContract = dynamic_cast<ContractDefinition const*>(
modifier->name()->annotation().referencedDeclaration
)->constructor(); baseConstructor && modifier->arguments())
))
if (
FunctionDefinition const* baseConstructor = baseContract->constructor();
baseConstructor && modifier->arguments()
)
baseConstructorArguments.emplace_back(
dynamic_cast<ContractDefinition const*>(baseConstructor->scope()),
modifier->arguments()