mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move dynamic type removal out of the type system.
This commit is contained in:
committed by
Alex Beregszaszi
parent
32c94f5059
commit
cc2f71e4ac
@@ -1551,16 +1551,22 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
|
||||
_functionCall.expression().annotation().isPure &&
|
||||
functionType->isPure();
|
||||
|
||||
bool allowDynamicTypes = false; // @TODO
|
||||
if (!functionType)
|
||||
{
|
||||
m_errorReporter.typeError(_functionCall.location(), "Type is not callable");
|
||||
_functionCall.annotation().type = make_shared<TupleType>();
|
||||
return false;
|
||||
}
|
||||
else if (functionType->returnParameterTypes().size() == 1)
|
||||
_functionCall.annotation().type = functionType->returnParameterTypes().front();
|
||||
|
||||
auto returnTypes =
|
||||
allowDynamicTypes ?
|
||||
functionType->returnParameterTypes() :
|
||||
functionType->returnParameterTypesWithoutDynamicTypes();
|
||||
if (returnTypes.size() == 1)
|
||||
_functionCall.annotation().type = returnTypes.front();
|
||||
else
|
||||
_functionCall.annotation().type = make_shared<TupleType>(functionType->returnParameterTypes());
|
||||
_functionCall.annotation().type = make_shared<TupleType>(returnTypes);
|
||||
|
||||
if (auto functionName = dynamic_cast<Identifier const*>(&_functionCall.expression()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user