aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-21 07:40:38 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-03-21 22:53:29 +0800
commitcc2f71e4acede70f6c220d3d0ba407ab73c2024c (patch)
treeb280c6bbd441b395a3ed172bdb01d60f40ff15a7 /libsolidity/analysis
parent32c94f505901201126000eb12087251f5695acbd (diff)
downloaddexon-solidity-cc2f71e4acede70f6c220d3d0ba407ab73c2024c.tar.gz
dexon-solidity-cc2f71e4acede70f6c220d3d0ba407ab73c2024c.tar.zst
dexon-solidity-cc2f71e4acede70f6c220d3d0ba407ab73c2024c.zip
Move dynamic type removal out of the type system.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index bebdb9b6..c8e64c78 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -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()))
{