mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improved error messages when converting to/from builtin functions
This commit is contained in:
@@ -2171,7 +2171,8 @@ void TypeChecker::typeCheckFunctionGeneralChecks(
|
||||
for (size_t i = 0; i < paramArgMap.size(); ++i)
|
||||
{
|
||||
solAssert(!!paramArgMap[i], "unmapped parameter");
|
||||
if (!type(*paramArgMap[i])->isImplicitlyConvertibleTo(*parameterTypes[i]))
|
||||
BoolResult result = type(*paramArgMap[i])->isImplicitlyConvertibleTo(*parameterTypes[i]);
|
||||
if (!result)
|
||||
{
|
||||
auto [errorId, description] = [&]() -> tuple<ErrorId, string> {
|
||||
string msg =
|
||||
@@ -2181,6 +2182,8 @@ void TypeChecker::typeCheckFunctionGeneralChecks(
|
||||
" to " +
|
||||
parameterTypes[i]->toString() +
|
||||
" requested.";
|
||||
if (!result.message().empty())
|
||||
msg += " " + result.message();
|
||||
if (
|
||||
_functionType->kind() == FunctionType::Kind::BareCall ||
|
||||
_functionType->kind() == FunctionType::Kind::BareCallCode ||
|
||||
|
||||
Reference in New Issue
Block a user