diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-12 04:08:39 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-14 05:09:01 +0800 |
commit | 033fc0cb1acab770e25f54d7ee2d50be994a4e45 (patch) | |
tree | b7aaa60096388336b6808ba0d77a5b5f2bbf4f63 /libsolidity | |
parent | 556ddd0f381f532d322758e3e00485055e7d1ed0 (diff) | |
download | dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar.gz dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.tar.zst dexon-solidity-033fc0cb1acab770e25f54d7ee2d50be994a4e45.zip |
Include types in explicit conversion error message
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 9 |
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; |