mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extra asserts, test renaming, test for super in modifiers
This commit is contained in:
parent
4cbf9ff74c
commit
67e87147b4
@ -286,7 +286,11 @@ FunctionDefinition const& CompilerContext::superFunction(FunctionDefinition cons
|
|||||||
solAssert(m_mostDerivedContract, "No most derived contract set.");
|
solAssert(m_mostDerivedContract, "No most derived contract set.");
|
||||||
ContractDefinition const* super = _base.superContract(mostDerivedContract());
|
ContractDefinition const* super = _base.superContract(mostDerivedContract());
|
||||||
solAssert(super, "Super contract not available.");
|
solAssert(super, "Super contract not available.");
|
||||||
return _function.resolveVirtual(mostDerivedContract(), super);
|
|
||||||
|
FunctionDefinition const& resolvedFunction = _function.resolveVirtual(mostDerivedContract(), super);
|
||||||
|
solAssert(resolvedFunction.isImplemented(), "");
|
||||||
|
|
||||||
|
return resolvedFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContractDefinition const& CompilerContext::mostDerivedContract() const
|
ContractDefinition const& CompilerContext::mostDerivedContract() const
|
||||||
|
@ -604,6 +604,8 @@ bool ContractCompiler::visit(VariableDeclaration const& _variableDeclaration)
|
|||||||
|
|
||||||
bool ContractCompiler::visit(FunctionDefinition const& _function)
|
bool ContractCompiler::visit(FunctionDefinition const& _function)
|
||||||
{
|
{
|
||||||
|
solAssert(_function.isImplemented(), "");
|
||||||
|
|
||||||
CompilerContext::LocationSetter locationSetter(m_context, _function);
|
CompilerContext::LocationSetter locationSetter(m_context, _function);
|
||||||
|
|
||||||
m_context.startFunction(_function);
|
m_context.startFunction(_function);
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
contract C {
|
||||||
|
modifier m() { _; }
|
||||||
|
}
|
||||||
|
contract D is C {
|
||||||
|
function f() super.m public {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// DeclarationError 7920: (74-81): Identifier not found or not unique.
|
Loading…
Reference in New Issue
Block a user