mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5451 from ethereum/bound_function_tests
Add assert and tests for bound functions
This commit is contained in:
@@ -529,6 +529,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
{
|
||||
bool shortcutTaken = false;
|
||||
if (auto identifier = dynamic_cast<Identifier const*>(&_functionCall.expression()))
|
||||
{
|
||||
solAssert(!function.bound(), "");
|
||||
if (auto functionDef = dynamic_cast<FunctionDefinition const*>(identifier->annotation().referencedDeclaration))
|
||||
{
|
||||
// Do not directly visit the identifier, because this way, we can avoid
|
||||
@@ -537,6 +539,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
utils().pushCombinedFunctionEntryLabel(m_context.resolveVirtualFunction(*functionDef), false);
|
||||
shortcutTaken = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shortcutTaken)
|
||||
_functionCall.expression().accept(*this);
|
||||
|
||||
Reference in New Issue
Block a user