solidity/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol

15 lines
536 B
Solidity
Raw Normal View History

struct S {
uint8 x;
}
2021-10-11 08:16:52 +00:00
function id(uint16 x) pure returns(uint16) {
return x;
}
contract C {
using {id} for uint256;
using {id} for S;
2021-10-11 08:16:52 +00:00
}
// ----
// TypeError 3100: (112-114): The function "id" cannot be attached 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 attached to the type "struct S" because the type cannot be implicitly converted to the first argument of the function ("uint16").