mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix the using directive implicit conversion error message.
This commit is contained in:
parent
257b2f2d0e
commit
8bb8373436
@ -3910,7 +3910,7 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
|
||||
3100_error,
|
||||
path->location(),
|
||||
"The function \"" + joinHumanReadable(path->path(), ".") + "\" "+
|
||||
"cannot be bound to the type \"" + _usingFor.typeName()->annotation().type->humanReadableName() +
|
||||
"cannot be bound to the type \"" + _usingFor.typeName()->annotation().type->canonicalName() +
|
||||
"\" because the type cannot be implicitly converted to the first argument" +
|
||||
" of the function (\"" + functionType->selfType()->humanReadableName() + "\")" +
|
||||
(
|
||||
|
@ -1,8 +1,14 @@
|
||||
struct S {
|
||||
uint8 x;
|
||||
}
|
||||
|
||||
function id(uint16 x) pure returns(uint16) {
|
||||
return x;
|
||||
}
|
||||
contract C {
|
||||
using {id} for uint256;
|
||||
using {id} for S;
|
||||
}
|
||||
// ----
|
||||
// TypeError 3100: (85-87): The function "id" cannot be bound to the type "uint256" because the type cannot be implicitly converted to the first argument of the function ("uint16").
|
||||
// TypeError 3100: (112-114): The function "id" cannot be bound to the type "uint256" because the type cannot be implicitly converted to the first argument of the function ("uint16").
|
||||
// TypeError 3100: (140-142): The function "id" cannot be bound to the type "S" because the type cannot be implicitly converted to the first argument of the function ("uint16").
|
||||
|
Loading…
Reference in New Issue
Block a user