From c2971834670a4209b378a03217a198d1b12ef9c3 Mon Sep 17 00:00:00 2001 From: wechman Date: Wed, 6 Jul 2022 09:17:59 +0200 Subject: [PATCH] Test that built-ins cannot be bound to structs --- .../using/free_functions_implicit_conversion_err.sol | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol b/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol index 36f3f3032..80c117cbb 100644 --- a/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol +++ b/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol @@ -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 "struct S storage pointer" because the type cannot be implicitly converted to the first argument of the function ("uint16").