Skip to content

Commit c297183

Browse files
wechmannikola-matic
authored andcommitted
Test that built-ins cannot be bound to structs
1 parent 2cc6610 commit c297183

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
struct S {
2+
uint8 x;
3+
}
4+
15
function id(uint16 x) pure returns(uint16) {
26
return x;
37
}
48
contract C {
59
using {id} for uint256;
10+
using {id} for S;
611
}
712
// ----
8-
// 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").
13+
// 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").
14+
// 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").

0 commit comments

Comments
 (0)