mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix check that mappings can only have storage location
This commit is contained in:
+2
-2
@@ -2,5 +2,5 @@ contract c {
|
||||
function f1(mapping(uint => uint) calldata) pure external returns (mapping(uint => uint) memory) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (29-59): Mapping types for parameters or return variables can only be used in internal or library functions.
|
||||
// TypeError: (84-112): Mapping types for parameters or return variables can only be used in internal or library functions.
|
||||
// TypeError: (29-59): Mapping types can only have a data location of "storage" and thus only be parameters or return variables for internal or library functions.
|
||||
// TypeError: (84-112): Mapping types can only have a data location of "storage" and thus only be parameters or return variables for internal or library functions.
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
contract c {
|
||||
function f4(mapping(uint => uint) memory) pure internal {}
|
||||
function f4(mapping(uint => uint) storage) pure internal {}
|
||||
function f5(mapping(uint => uint) memory) pure internal {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (93-121): Mapping types can only have a data location of "storage".
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ contract c {
|
||||
function f3(mapping(uint => uint) memory) view public {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (29-57): Mapping types for parameters or return variables can only be used in internal or library functions.
|
||||
// TypeError: (29-57): Mapping types can only have a data location of "storage" and thus only be parameters or return variables for internal or library functions.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (51-79): Mapping types for parameters or return variables can only be used in internal or library functions.
|
||||
// TypeError: (51-79): Mapping types can only have a data location of "storage" and thus only be parameters or return variables for internal or library functions.
|
||||
|
||||
Reference in New Issue
Block a user