diff options
Diffstat (limited to 'test/libsolidity/syntaxTests')
9 files changed, 25 insertions, 40 deletions
diff --git a/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_reference_type.sol b/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_reference_type.sol index bd011f2d..0fbad155 100644 --- a/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_reference_type.sol +++ b/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_reference_type.sol @@ -4,11 +4,10 @@ contract test { function f() public { uint[] storage s1 = a; uint[] memory s2 = new uint[](42); - uint[] s3 = b; + uint[] storage s3 = b; s1.push(42); s2[3] = 12; s3.push(42); } } // ---- -// Warning: (147-156): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/232_literal_string_to_storage_pointer.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/232_literal_string_to_storage_pointer.sol index a586dc80..be57144e 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/232_literal_string_to_storage_pointer.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/232_literal_string_to_storage_pointer.sol @@ -1,6 +1,5 @@ contract C { - function f() public { string x = "abc"; } + function f() public { string storage x = "abc"; } } // ---- -// Warning: (39-47): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. -// TypeError: (39-55): Type literal_string "abc" is not implicitly convertible to expected type string storage pointer. +// TypeError: (39-63): Type literal_string "abc" is not implicitly convertible to expected type string storage pointer. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/250_member_access_parser_ambiguity.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/250_member_access_parser_ambiguity.sol index f5252180..0ab3c198 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/250_member_access_parser_ambiguity.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/250_member_access_parser_ambiguity.sol @@ -3,15 +3,14 @@ contract C { struct S { uint a; uint b; uint[20][20][20] c; R d; } S data; function f() public { - C.S x = data; + C.S storage x = data; C.S memory y; C.S[10] memory z; C.S[10]; y.a = 2; x.c[1][2][3] = 9; x.d.y[2][2] = 3; + z; } } // ---- -// Warning: (150-155): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. -// Warning: (194-210): Unused local variable. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/276_invalid_types_in_inline_array.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/276_invalid_types_in_inline_array.sol index 6c8aabd5..03d7266a 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/276_invalid_types_in_inline_array.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/276_invalid_types_in_inline_array.sol @@ -1,8 +1,7 @@ contract C { function f() public { - uint[3] x = [45, 'foo', true]; + uint[3] memory x = [45, 'foo', true]; } } // ---- -// Warning: (47-56): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. -// TypeError: (59-76): Unable to deduce common type for array elements. +// TypeError: (66-83): Unable to deduce common type for array elements. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/471_unspecified_storage_fail.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/471_unspecified_storage_fail.sol new file mode 100644 index 00000000..6e401920 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/471_unspecified_storage_fail.sol @@ -0,0 +1,13 @@ +contract C { + struct S { uint a; } + S m_x; + uint[] m_y; + function f() view public { + S x = m_x; + uint[] y = m_y; + x; y; + } +} +// ---- +// TypeError: (104-107): Data location must be specified as either "memory" or "storage". +// TypeError: (123-131): Data location must be specified as either "memory" or "storage". diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/471_unspecified_storage_warn.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/471_unspecified_storage_warn.sol deleted file mode 100644 index aa16a6b4..00000000 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/471_unspecified_storage_warn.sol +++ /dev/null @@ -1,10 +0,0 @@ -contract C { - struct S { uint a; } - S x; - function f() view public { - S y = x; - y; - } -} -// ---- -// Warning: (86-89): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/472_unspecified_storage_v050.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/472_unspecified_storage_v050.sol deleted file mode 100644 index 179c9931..00000000 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/472_unspecified_storage_v050.sol +++ /dev/null @@ -1,11 +0,0 @@ -pragma experimental "v0.5.0"; -contract C { - struct S { uint a; } - S x; - function f() view public { - S y = x; - y; - } -} -// ---- -// TypeError: (116-119): Data location must be specified as either "memory" or "storage". diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/481_explicit_literal_to_unspecified_string_assignment.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/481_explicit_literal_to_unspecified_string_assignment.sol index 9801b831..ee56204a 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/481_explicit_literal_to_unspecified_string_assignment.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/481_explicit_literal_to_unspecified_string_assignment.sol @@ -1,8 +1,7 @@ contract C { function f() pure public { - string x = "abc"; + string storage x = "abc"; } } // ---- -// Warning: (52-60): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. -// TypeError: (52-68): Type literal_string "abc" is not implicitly convertible to expected type string storage pointer. +// TypeError: (52-76): Type literal_string "abc" is not implicitly convertible to expected type string storage pointer. diff --git a/test/libsolidity/syntaxTests/parsing/arrays_in_expressions.sol b/test/libsolidity/syntaxTests/parsing/arrays_in_expressions.sol index 2b35ffda..4c1f96e6 100644 --- a/test/libsolidity/syntaxTests/parsing/arrays_in_expressions.sol +++ b/test/libsolidity/syntaxTests/parsing/arrays_in_expressions.sol @@ -1,8 +1,6 @@ contract c { - function f() public { c[10] a = 7; uint8[10 * 2] x; } + function f() public { c[10] storage a = 7; uint8[10 * 2] storage x; } } // ---- -// Warning: (39-46): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. -// Warning: (52-67): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. -// TypeError: (39-50): Type int_const 7 is not implicitly convertible to expected type contract c[10] storage pointer. -// DeclarationError: (52-67): Uninitialized storage pointer. Did you mean '<type> memory x'? +// TypeError: (39-58): Type int_const 7 is not implicitly convertible to expected type contract c[10] storage pointer. +// DeclarationError: (60-83): Uninitialized storage pointer. |