mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Include types in explicit conversion error message
This commit is contained in:
parent
556ddd0f38
commit
033fc0cb1a
@ -4,6 +4,7 @@ Features:
|
|||||||
* Inline Assembly: Show useful error message if trying to access calldata variables.
|
* Inline Assembly: Show useful error message if trying to access calldata variables.
|
||||||
* Inline Assembly: Support variable declaration without initial value (defaults to 0).
|
* Inline Assembly: Support variable declaration without initial value (defaults to 0).
|
||||||
* Type Checker: Disallow value transfers to contracts without a payable fallback function.
|
* Type Checker: Disallow value transfers to contracts without a payable fallback function.
|
||||||
|
* Type Checker: Include types in explicit conversion error message.
|
||||||
* Type Checker: Raise proper error for arrays too large for ABI encoding.
|
* Type Checker: Raise proper error for arrays too large for ABI encoding.
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
@ -1364,7 +1364,14 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
|
|||||||
// (data location cannot yet be specified for type conversions)
|
// (data location cannot yet be specified for type conversions)
|
||||||
resultType = ReferenceType::copyForLocationIfReference(argRefType->location(), resultType);
|
resultType = ReferenceType::copyForLocationIfReference(argRefType->location(), resultType);
|
||||||
if (!argType->isExplicitlyConvertibleTo(*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().type = resultType;
|
||||||
_functionCall.annotation().isPure = isPure;
|
_functionCall.annotation().isPure = isPure;
|
||||||
|
Loading…
Reference in New Issue
Block a user