diff options
Diffstat (limited to 'test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol')
-rw-r--r-- | test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol | 11 |
1 files changed, 11 insertions, 0 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 new file mode 100644 index 00000000..2a485581 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type.sol @@ -0,0 +1,11 @@ +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. |