aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/TypeChecker.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-12 04:08:39 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-14 05:09:01 +0800
commit033fc0cb1acab770e25f54d7ee2d50be994a4e45 (patch)
treeb7aaa60096388336b6808ba0d77a5b5f2bbf4f63 /libsolidity/analysis/TypeChecker.cpp
parent556ddd0f381f532d322758e3e00485055e7d1ed0 (diff)
downloaddexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar
dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar.gz
dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar.bz2
dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar.lz
dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar.xz
dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar.zst
dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.zip
Include types in explicit conversion error message
Diffstat (limited to 'libsolidity/analysis/TypeChecker.cpp')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 29db7441..23f01752 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -1364,7 +1364,14 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
// (data location cannot yet be specified for type conversions)
resultType = ReferenceType::copyForLocationIfReference(argRefType->location(), resultType);
if (!argType->isExplicitlyConvertibleTo(*resultType))
- m_errorReporter.typeError(_functionCall.location(), "Explicit type conversion not allowed.");
+ m_errorReporter.typeError(
+ _functionCall.location(),
+ "Explicit type conversion not allowed from \"" +
+ argType->toString() +
+ "\" to \"" +
+ resultType->toString() +
+ "\"."
+ );
}
_functionCall.annotation().type = resultType;
_functionCall.annotation().isPure = isPure;