mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add tests for data locations within libraries
This commit is contained in:
parent
167fe7c370
commit
ee85430f93
@ -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