Allow function overloads involving MagicVariableDeclarations.

This commit is contained in:
chriseth
2018-04-12 13:09:37 +02:00
parent 17fc0f54b5
commit f00bb43593
4 changed files with 18 additions and 7 deletions
+3 -4
View File
@@ -2124,10 +2124,9 @@ bool TypeChecker::visit(Identifier const& _identifier)
for (Declaration const* declaration: annotation.overloadedDeclarations)
{
TypePointer function = declaration->type();
solAssert(!!function, "Requested type not present.");
auto const* functionType = dynamic_cast<FunctionType const*>(function.get());
if (functionType && functionType->canTakeArguments(*annotation.argumentTypes))
FunctionTypePointer functionType = declaration->functionType(true);
solAssert(!!functionType, "Requested type not present.");
if (functionType->canTakeArguments(*annotation.argumentTypes))
candidates.push_back(declaration);
}
if (candidates.empty())