diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/incomp_types.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/incomp_types.sol new file mode 100644 index 000000000..7f2139bf7 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/incomp_types.sol @@ -0,0 +1,7 @@ +contract C { + function f() public returns (uint a, uint b) { + a += (1, 1); + } +} +// ---- +// TypeError: (72-83): Operator += not compatible with types uint256 and tuple(int_const 1,int_const 1) diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/249_tuple_compound_assignment.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/tuple.sol similarity index 100% rename from test/libsolidity/syntaxTests/nameAndTypeResolution/249_tuple_compound_assignment.sol rename to test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/tuple.sol diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/tuple_invalid_inline_array_type.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/tuple_invalid_inline_array_type.sol new file mode 100644 index 000000000..17892ec05 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/compoundAssignment/tuple_invalid_inline_array_type.sol @@ -0,0 +1,8 @@ +contract C { + function f() pure public { + uint x; + (x, ) = ([100e100]); + } +} +// ---- +// TypeError: (78-85): Invalid mobile type. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/266_invalid_args_creating_memory_array.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_memory_array.sol similarity index 100% rename from test/libsolidity/syntaxTests/nameAndTypeResolution/266_invalid_args_creating_memory_array.sol rename to test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_memory_array.sol diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/267_invalid_args_creating_struct.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_struct.sol similarity index 100% rename from test/libsolidity/syntaxTests/nameAndTypeResolution/267_invalid_args_creating_struct.sol rename to test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_struct.sol diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_struct_members_skipped.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_struct_members_skipped.sol new file mode 100644 index 000000000..1e954ab6c --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/creating_struct_members_skipped.sol @@ -0,0 +1,9 @@ +contract C { + struct S { uint a; uint b; mapping(uint=>uint) c; } + + function f() public { + S memory s = S({a: 1}); + } +} +// ---- +// TypeError: (117-126): Wrong argument count for struct constructor: 1 arguments given but expected 2. Members that have to be skipped in memory: c diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/explicit_conversions.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/explicit_conversions.sol new file mode 100644 index 000000000..c81b60351 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/invalidArgs/explicit_conversions.sol @@ -0,0 +1,9 @@ +contract test { + function f() public { + uint(1, 1); + uint({arg:1}); + } +} +// ---- +// TypeError: (50-60): Exactly one argument expected for explicit type conversion. +// TypeError: (70-83): Type conversion cannot allow named arguments.