mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4556 from ethereum/library-data-locations
Add tests for data locations within libraries
This commit is contained in:
commit
61b94b7ea4
@ -0,0 +1,3 @@
|
||||
library test {
|
||||
function f(bytes calldata) external;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
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).
|
@ -0,0 +1,3 @@
|
||||
library test {
|
||||
function f(bytes storage) external;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
library test {
|
||||
function f(bytes calldata) internal pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (30-35): Variable cannot be declared as "calldata" (remove the "calldata" keyword).
|
@ -0,0 +1,3 @@
|
||||
library test {
|
||||
function f(bytes memory) internal pure {}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
library test {
|
||||
function f(bytes storage) internal pure {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user