mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add update suggestion.
This commit is contained in:
parent
20b23e124b
commit
4354ef2ef4
@ -1478,12 +1478,28 @@ TypePointer TypeChecker::typeCheckTypeConversionAndRetrieveReturnType(
|
||||
variableDeclaration->location()
|
||||
);
|
||||
m_errorReporter.typeError(
|
||||
_functionCall.location(), ssl,
|
||||
_functionCall.location(),
|
||||
ssl,
|
||||
"Explicit type conversion not allowed from non-payable \"address\" to \"" +
|
||||
resultType->toString() +
|
||||
"\", which has a payable fallback function."
|
||||
);
|
||||
}
|
||||
else if (
|
||||
auto const* functionType = dynamic_cast<FunctionType const*>(argType);
|
||||
functionType &&
|
||||
functionType->kind() == FunctionType::Kind::External &&
|
||||
resultType->category() == Type::Category::Address
|
||||
)
|
||||
m_errorReporter.typeError(
|
||||
_functionCall.location(),
|
||||
"Explicit type conversion not allowed from \"" +
|
||||
argType->toString() +
|
||||
"\" to \"" +
|
||||
resultType->toString() +
|
||||
"\". To obtain the address of the contract of the function, " +
|
||||
"you can use the .address member of the function."
|
||||
);
|
||||
else
|
||||
m_errorReporter.typeError(
|
||||
_functionCall.location(),
|
||||
|
@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-92): Explicit type conversion not allowed from "function () view external returns (address)" to "address".
|
||||
// TypeError: (77-92): Explicit type conversion not allowed from "function () view external returns (address)" to "address". To obtain the address of the contract of the function, you can use the .address member of the function.
|
||||
|
Loading…
Reference in New Issue
Block a user