Merge pull request #4556 from ethereum/library-data-locations

Add tests for data locations within libraries
This commit is contained in:
Alex Beregszaszi
2018-07-25 18:03:30 +01:00
committed by GitHub
6 changed files with 22 additions and 0 deletions
@@ -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 {}
}