Implemented events with function type as one of its indexed parameters

This commit is contained in:
Harikrishnan Mulackal
2020-09-30 12:11:38 +02:00
parent 7a86a61b08
commit 3970412422
5 changed files with 89 additions and 5 deletions
+20 -5
View File
@@ -867,11 +867,26 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
else
{
solAssert(paramTypes[arg - 1]->isValueType(), "");
utils().convertType(
*arguments[arg - 1]->annotation().type,
*paramTypes[arg - 1],
true
);
if (auto functionType = dynamic_cast<FunctionType const*>(paramTypes[arg - 1]))
{
auto argumentType =
dynamic_cast<FunctionType const*>(arguments[arg-1]->annotation().type);
solAssert(
argumentType &&
functionType->kind() == FunctionType::Kind::External &&
argumentType->kind() == FunctionType::Kind::External &&
!argumentType->bound(),
""
);
utils().combineExternalFunctionType(true);
}
else
utils().convertType(
*arguments[arg - 1]->annotation().type,
*paramTypes[arg - 1],
true
);
}
}
if (!event.isAnonymous())