diff options
author | chriseth <chris@ethereum.org> | 2018-08-08 01:12:49 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-08-15 00:53:06 +0800 |
commit | 13905a2094d454aa94259412a3cf20a5f8176fff (patch) | |
tree | 40ee6df0b3e735df5f192744caad5910e559c1ec /test/libsolidity/syntaxTests/dataLocations | |
parent | 16de7a04935ecee9c33392965f23dcfc775b799d (diff) | |
download | dexon-solidity-13905a2094d454aa94259412a3cf20a5f8176fff.tar dexon-solidity-13905a2094d454aa94259412a3cf20a5f8176fff.tar.gz dexon-solidity-13905a2094d454aa94259412a3cf20a5f8176fff.tar.bz2 dexon-solidity-13905a2094d454aa94259412a3cf20a5f8176fff.tar.lz dexon-solidity-13905a2094d454aa94259412a3cf20a5f8176fff.tar.xz dexon-solidity-13905a2094d454aa94259412a3cf20a5f8176fff.tar.zst dexon-solidity-13905a2094d454aa94259412a3cf20a5f8176fff.zip |
Update tests.
Diffstat (limited to 'test/libsolidity/syntaxTests/dataLocations')
32 files changed, 128 insertions, 66 deletions
diff --git a/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol index 2a485581..b23fbb89 100644 --- a/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol +++ b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol @@ -1,11 +1,4 @@ library L { struct Nested { uint y; } - // data location specifier in function signature should be optional even if there are multiple choices - function a(function(Nested) external returns (uint)[] storage) external pure {} - function b(function(Nested calldata) external returns (uint)[] storage) external pure {} function c(function(Nested memory) external returns (uint)[] storage) external pure {} - function d(function(Nested storage) external returns (uint)[] storage) external pure {} } - -// ---- -// TypeError: (441-447): Location has to be calldata or memory for function type of external function. Remove the data location keyword to fix this error. diff --git a/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol new file mode 100644 index 00000000..e1ea6989 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol @@ -0,0 +1,9 @@ +library L { + struct Nested { uint y; } + function b(function(Nested calldata) external returns (uint)[] storage) external pure {} + function d(function(Nested storage) external returns (uint)[] storage) external pure {} +} + +// ---- +// TypeError: (66-72): Data location must be "memory" for parameter in function, but "calldata" was given. +// TypeError: (159-165): Data location must be "memory" for parameter in function, but "storage" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/externalFunction/external_function_return_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/externalFunction/external_function_return_parameters_no_data_location.sol index 0ed954ed..cbcf2a6e 100644 --- a/test/libsolidity/syntaxTests/dataLocations/externalFunction/external_function_return_parameters_no_data_location.sol +++ b/test/libsolidity/syntaxTests/dataLocations/externalFunction/external_function_return_parameters_no_data_location.sol @@ -2,4 +2,4 @@ contract C { function i() external pure returns(uint[]) {} } // ---- -// TypeError: (52-58): Storage location must be "memory" for parameter in external function, but none was given. +// TypeError: (52-58): Data location must be "memory" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_memory.sol b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_memory.sol index 807cc064..d914fa5b 100644 --- a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_memory.sol +++ b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_memory.sol @@ -2,4 +2,4 @@ contract test { function f(bytes memory) external; } // ---- -// TypeError: (31-36): Location has to be calldata for external functions (remove the "memory" or "storage" keyword). +// TypeError: (31-36): Data location must be "calldata" for parameter in external function, but "memory" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_storage.sol b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_storage.sol index 2664dbab..adb7e52e 100644 --- a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_storage.sol +++ b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_storage.sol @@ -2,4 +2,4 @@ contract test { function f(bytes storage) external; } // ---- -// TypeError: (31-36): Location has to be calldata for external functions (remove the "memory" or "storage" keyword). +// TypeError: (31-36): Data location must be "calldata" for parameter in external function, but "storage" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_library.sol b/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_library.sol deleted file mode 100644 index 4348482a..00000000 --- a/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_library.sol +++ /dev/null @@ -1,5 +0,0 @@ -library test { - function f(bytes calldata) public; -} -// ---- -// TypeError: (30-35): Location cannot be calldata for non-external functions (remove the "calldata" keyword). diff --git a/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_non_reference_type.sol b/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_non_reference_type.sol index 70f6c5eb..71756ebb 100644 --- a/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_non_reference_type.sol +++ b/test/libsolidity/syntaxTests/dataLocations/function_argument_location_specifier_test_non_reference_type.sol @@ -2,4 +2,4 @@ contract test { function f(bytes4 memory) public; } // ---- -// TypeError: (31-37): Data location can only be given for array or struct types. +// TypeError: (31-37): Data location can only be specified for array, struct or mapping types, but "memory" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/function_parameters_with_data_location_fine.sol b/test/libsolidity/syntaxTests/dataLocations/function_parameters_with_data_location_fine.sol index da4a7354..2bc7b393 100644 --- a/test/libsolidity/syntaxTests/dataLocations/function_parameters_with_data_location_fine.sol +++ b/test/libsolidity/syntaxTests/dataLocations/function_parameters_with_data_location_fine.sol @@ -1,10 +1,8 @@ contract C { - // Warning for no data location provided can be silenced with storage or memory. function f(uint[] memory, uint[] storage) private pure {} function g(uint[] memory, uint[] storage) internal pure {} function h(uint[] memory) public pure {} - // No warning on external functions, because of default to calldata. - function i(uint[]) external pure {} - // No warning for events. + function i(uint[] calldata) external pure {} + // No data location for events. event e(uint[]); -}
\ No newline at end of file +} diff --git a/test/libsolidity/syntaxTests/dataLocations/function_return_parameters_with_data_location_fine.sol b/test/libsolidity/syntaxTests/dataLocations/function_return_parameters_with_data_location_fine.sol index 047b6b80..ea019198 100644 --- a/test/libsolidity/syntaxTests/dataLocations/function_return_parameters_with_data_location_fine.sol +++ b/test/libsolidity/syntaxTests/dataLocations/function_return_parameters_with_data_location_fine.sol @@ -1,7 +1,6 @@ contract C { - // Shows that the warning for no data location provided can be silenced with storage or memory. function f() private pure returns(uint[] memory, uint[] storage b) { b = b; } function g() internal pure returns(uint[] memory, uint[] storage b) { b = b; } function h() public pure returns(uint[] memory) {} function i() external pure returns(uint[] memory) {} -}
\ No newline at end of file +} diff --git a/test/libsolidity/syntaxTests/dataLocations/function_type_array_as_reference_type.sol b/test/libsolidity/syntaxTests/dataLocations/function_type_array_as_reference_type.sol index a5d6af34..b3856f58 100644 --- a/test/libsolidity/syntaxTests/dataLocations/function_type_array_as_reference_type.sol +++ b/test/libsolidity/syntaxTests/dataLocations/function_type_array_as_reference_type.sol @@ -1,10 +1,8 @@ contract C { struct Nested { uint y; } // ensure that we consider array of function pointers as reference type - function a(function(Nested) external returns (uint)[]) public pure {} - function b(function(Nested) external returns (uint)[] storage) public pure {} - function c(function(Nested) external returns (uint)[] memory) public pure {} - function d(function(Nested) external returns (uint)[] calldata) public pure {} + function b(function(Nested memory) external returns (uint)[] storage) internal pure {} + function c(function(Nested memory) external returns (uint)[] memory) public pure {} + function d(function(Nested memory) external returns (uint)[] calldata) external pure {} } // ---- -// TypeError: (208-250): Location has to be memory for public function. Remove the data location keyword to fix this error. diff --git a/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_calldata.sol b/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_calldata.sol index f2740946..771f1525 100644 --- a/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_calldata.sol +++ b/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_calldata.sol @@ -2,4 +2,4 @@ contract test { function f(bytes calldata) internal; } // ---- -// TypeError: (31-36): Variable cannot be declared as "calldata" (remove the "calldata" keyword). +// TypeError: (31-36): Data location must be "storage" or "memory" for parameter in function, but "calldata" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_parameters_no_data_location.sol index 1ec530a9..f1c4a550 100644 --- a/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_parameters_no_data_location.sol +++ b/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_parameters_no_data_location.sol @@ -2,4 +2,4 @@ contract C { function g(uint[]) internal pure {} } // ---- -// TypeError: (28-34): Storage location must be "storage" or "memory" for parameter in internal function, but none was given. +// TypeError: (28-34): Data location must be "storage" or "memory" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_return_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_return_parameters_no_data_location.sol index 243151f0..a32995e7 100644 --- a/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_return_parameters_no_data_location.sol +++ b/test/libsolidity/syntaxTests/dataLocations/internalFunction/internal_function_return_parameters_no_data_location.sol @@ -2,4 +2,4 @@ contract C { function g() internal pure returns(uint[]) {} } // ---- -// TypeError: (52-58): Storage location must be "storage" or "memory" for parameter in internal function, but none was given. +// TypeError: (52-58): Data location must be "storage" or "memory" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_params_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_params_no_data_location.sol new file mode 100644 index 00000000..c20088b7 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_params_no_data_location.sol @@ -0,0 +1,12 @@ +library L { + struct S { uint x; } + function g(uint[2]) external pure {} + function h(uint[]) external pure {} + function i(S) external pure {} + function j(mapping(uint => uint)) external pure {} +} +// ---- +// TypeError: (52-59): Data location must be "storage" or "calldata" for parameter in external function, but none was given. +// TypeError: (93-99): Data location must be "storage" or "calldata" for parameter in external function, but none was given. +// TypeError: (133-134): Data location must be "storage" or "calldata" for parameter in external function, but none was given. +// TypeError: (168-189): Data location must be "storage" or "calldata" for parameter in external function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_return_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_return_no_data_location.sol new file mode 100644 index 00000000..fa3a7821 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_external_function_return_no_data_location.sol @@ -0,0 +1,12 @@ +library L { + struct S { uint x; } + function g() external pure returns (uint[2]) {} + function h() external pure returns (uint[]) {} + function i() external pure returns (S) {} + function j() external pure returns (mapping(uint => uint)) {} +} +// ---- +// TypeError: (77-84): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (129-135): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (180-181): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (226-247): Data location must be "storage" or "memory" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_parameters_with_data_location_fine.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_parameters_with_data_location_fine.sol deleted file mode 100644 index f778b7ed..00000000 --- a/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_parameters_with_data_location_fine.sol +++ /dev/null @@ -1,8 +0,0 @@ -library L { - // Warning for no data location provided can be silenced with storage or memory. - function f(uint[] memory, uint[] storage) private pure {} - function g(uint[] memory, uint[] storage) internal pure {} - function h(uint[] memory) public pure {} - // No warning on external functions, because of default to calldata. - function i(uint[]) external pure {} -}
\ No newline at end of file diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_fine.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_fine.sol new file mode 100644 index 00000000..7a276f95 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_fine.sol @@ -0,0 +1,10 @@ +library L { + struct S { uint x; } + function f(uint[] memory, uint[] storage, S storage) private pure + returns (mapping(uint => uint) storage a, S memory b, uint[] storage c) { return (a, b, c); } + function g(uint[] memory, uint[] storage) internal pure + returns (mapping(uint => uint) storage a, S memory b, uint[] storage c) { return (a, b, c); } + function h(uint[] memory, uint[] storage) public pure returns (S storage x) { return x; } + function i(uint[] calldata, uint[] storage) external pure returns (S storage x) {return x; } +} +// ---- diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_internal_function_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_internal_function_no_data_location.sol new file mode 100644 index 00000000..68c177a8 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_internal_function_no_data_location.sol @@ -0,0 +1,20 @@ +library L { + struct S { uint x; } + function g() internal pure returns (uint[2]) {} + function h() internal pure returns (uint[]) {} + function i() internal pure returns (S) {} + function j() internal pure returns (mapping(uint => uint)) {} + function gp(uint[2]) internal pure {} + function hp(uint[]) internal pure {} + function ip(S) internal pure {} + function jp(mapping(uint => uint)) internal pure {} +} +// ---- +// TypeError: (77-84): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (129-135): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (180-181): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (226-247): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (268-275): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (310-316): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (351-352): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (387-408): Data location must be "storage" or "memory" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_internal_function_return_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_internal_function_return_parameters_no_data_location.sol deleted file mode 100644 index 8218dded..00000000 --- a/test/libsolidity/syntaxTests/dataLocations/libraries/library_internal_function_return_parameters_no_data_location.sol +++ /dev/null @@ -1,5 +0,0 @@ -library L { - function g(uint[]) internal pure {} -} -// ---- -// TypeError: (27-33): Storage location must be "storage" or "memory" for parameter in internal function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_private_function_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_private_function_no_data_location.sol new file mode 100644 index 00000000..35256eae --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_private_function_no_data_location.sol @@ -0,0 +1,20 @@ +library L { + struct S { uint x; } + function g() private pure returns (uint[2]) {} + function h() private pure returns (uint[]) {} + function i() private pure returns (S) {} + function j() private pure returns (mapping(uint => uint)) {} + function gp(uint[2]) private pure {} + function hp(uint[]) private pure {} + function ip(S) private pure {} + function jp(mapping(uint => uint)) private pure {} +} +// ---- +// TypeError: (76-83): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (127-133): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (177-178): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (222-243): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (264-271): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (305-311): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (345-346): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (380-401): Data location must be "storage" or "memory" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_private_function_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_private_function_parameters_no_data_location.sol deleted file mode 100644 index 79307cd0..00000000 --- a/test/libsolidity/syntaxTests/dataLocations/libraries/library_private_function_parameters_no_data_location.sol +++ /dev/null @@ -1,5 +0,0 @@ -library L { - function h(uint[]) public pure {} -} -// ---- -// TypeError: (27-33): Storage location must be "storage" or "memory" for parameter in public function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_public_function_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_public_function_no_data_location.sol new file mode 100644 index 00000000..f8f8dcb2 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_public_function_no_data_location.sol @@ -0,0 +1,19 @@ +library L { + struct S { uint x; } + function g() private pure returns (uint[2]) {} + function h() private pure returns (uint[]) {} + function i() private pure returns (S) {} + function j() private pure returns (mapping(uint => uint)) {} + function gp(uint[2]) private pure {} + function hp(uint[]) private pure {} + function ip(S) private pure {} + function jp(mapping(uint => uint)) private pure {}} +// ---- +// TypeError: (76-83): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (127-133): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (177-178): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (222-243): Data location must be "storage" or "memory" for return parameter in function, but none was given. +// TypeError: (264-271): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (305-311): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (345-346): Data location must be "storage" or "memory" for parameter in function, but none was given. +// TypeError: (380-401): Data location must be "storage" or "memory" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_public_function_return_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_public_function_return_parameters_no_data_location.sol deleted file mode 100644 index 79307cd0..00000000 --- a/test/libsolidity/syntaxTests/dataLocations/libraries/library_public_function_return_parameters_no_data_location.sol +++ /dev/null @@ -1,5 +0,0 @@ -library L { - function h(uint[]) public pure {} -} -// ---- -// TypeError: (27-33): Storage location must be "storage" or "memory" for parameter in public function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_memory.sol b/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_memory.sol index 6fa0a152..9a6b8b7c 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_memory.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_memory.sol @@ -2,4 +2,4 @@ library test { function f(bytes memory) external; } // ---- -// TypeError: (30-35): Location has to be calldata or storage for external library functions (remove the "memory" keyword). +// TypeError: (30-35): Data location must be "storage" or "calldata" for parameter in external function, but "memory" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_calldata.sol b/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_calldata.sol index 868c5c30..99b89dfc 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_calldata.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_calldata.sol @@ -2,4 +2,4 @@ library test { function f(bytes calldata) internal pure {} } // ---- -// TypeError: (30-35): Variable cannot be declared as "calldata" (remove the "calldata" keyword). +// TypeError: (30-35): Data location must be "storage" or "memory" for parameter in function, but "calldata" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_no_data_location.sol index 2f4e2a34..fdd5cbaf 100644 --- a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_no_data_location.sol +++ b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_no_data_location.sol @@ -2,4 +2,4 @@ contract C { function f(uint[]) private pure {} } // ---- -// TypeError: (28-34): Storage location must be "storage" or "memory" for parameter in private function, but none was given. +// TypeError: (28-34): Data location must be "storage" or "memory" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_no_data_location.sol index 5356f944..65ec1bce 100644 --- a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_no_data_location.sol +++ b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_no_data_location.sol @@ -2,4 +2,4 @@ contract C { function f() private pure returns(uint[]) {} } // ---- -// TypeError: (51-57): Storage location must be "storage" or "memory" for parameter in private function, but none was given. +// TypeError: (51-57): Data location must be "storage" or "memory" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_calldata.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_calldata.sol index cb00199f..efc92cf3 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_calldata.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_calldata.sol @@ -2,4 +2,4 @@ contract test { function f(bytes calldata) public; } // ---- -// TypeError: (31-36): Location has to be memory for publicly visible functions (remove the "storage" or "calldata" keyword). +// TypeError: (31-36): Data location must be "memory" for parameter in function, but "calldata" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_storage.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_storage.sol index 9380d9df..b954ea78 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_storage.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_storage.sol @@ -2,4 +2,4 @@ contract test { function f(bytes storage) public; } // ---- -// TypeError: (31-36): Location has to be memory for publicly visible functions (remove the "storage" or "calldata" keyword). +// TypeError: (31-36): Data location must be "memory" for parameter in function, but "storage" was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_parameters_no_data_location.sol index 47d9c47b..f76bd631 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_parameters_no_data_location.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_parameters_no_data_location.sol @@ -2,4 +2,4 @@ contract C { function h(uint[]) public pure {} } // ---- -// TypeError: (28-34): Storage location must be "memory" for parameter in public function, but none was given. +// TypeError: (28-34): Data location must be "memory" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_no_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_no_data_location.sol index 42980c51..6b087c34 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_no_data_location.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_no_data_location.sol @@ -2,4 +2,4 @@ contract C { function h() public pure returns(uint[]) {} } // ---- -// TypeError: (50-56): Storage location must be "memory" for parameter in public function, but none was given. +// TypeError: (50-56): Data location must be "memory" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_non_reference_type.sol b/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_non_reference_type.sol index ac312685..5f6daf68 100644 --- a/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_non_reference_type.sol +++ b/test/libsolidity/syntaxTests/dataLocations/variable_declaration_location_specifier_test_non_reference_type.sol @@ -7,7 +7,7 @@ contract test { } } // ---- -// TypeError: (48-63): Data location can only be given for array or struct types. -// TypeError: (71-89): Data location can only be given for array or struct types. -// TypeError: (97-111): Data location can only be given for array or struct types. -// TypeError: (119-136): Data location can only be given for array or struct types. +// TypeError: (48-63): Data location can only be specified for array, struct or mapping types, but "storage" was given. +// TypeError: (71-89): Data location can only be specified for array, struct or mapping types, but "storage" was given. +// TypeError: (97-111): Data location can only be specified for array, struct or mapping types, but "memory" was given. +// TypeError: (119-136): Data location can only be specified for array, struct or mapping types, but "memory" was given. |