mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Refactoring nextConstructor by moving it from CompilerContext to ContractDefinition
This commit is contained in:
@@ -159,7 +159,7 @@ void ContractCompiler::appendInitAndConstructorCode(ContractDefinition const& _c
|
||||
|
||||
if (FunctionDefinition const* constructor = _contract.constructor())
|
||||
appendConstructor(*constructor);
|
||||
else if (auto c = m_context.nextConstructor(_contract))
|
||||
else if (auto c = _contract.nextConstructor(m_context.mostDerivedContract()))
|
||||
appendBaseConstructor(*c);
|
||||
else
|
||||
appendCallValueCheck();
|
||||
@@ -596,7 +596,9 @@ bool ContractCompiler::visit(FunctionDefinition const& _function)
|
||||
appendStackVariableInitialisation(*variable);
|
||||
|
||||
if (_function.isConstructor())
|
||||
if (auto c = m_context.nextConstructor(dynamic_cast<ContractDefinition const&>(*_function.scope())))
|
||||
if (auto c = dynamic_cast<ContractDefinition const&>(*_function.scope()).nextConstructor(
|
||||
m_context.mostDerivedContract()
|
||||
))
|
||||
appendBaseConstructor(*c);
|
||||
|
||||
solAssert(m_returnTags.empty(), "");
|
||||
|
||||
Reference in New Issue
Block a user