Merge pull request #5382 from ethereum/libraryMappingPublic

Allow mapping arguments for public and external library functions.
This commit is contained in:
chriseth
2018-11-26 19:47:32 +01:00
committed by GitHub
11 changed files with 106 additions and 27 deletions
@@ -3,4 +3,3 @@ library L {
}
}
// ----
// TypeError: (27-56): Type is required to live outside storage.
@@ -3,4 +3,3 @@ library L {
}
}
// ----
// TypeError: (27-56): Type is required to live outside storage.
@@ -5,6 +5,3 @@ library L
}
}
// ----
// TypeError: (27-58): Type is required to live outside storage.
// TypeError: (60-91): Type is required to live outside storage.
// TypeError: (123-152): Type is required to live outside storage.
@@ -5,6 +5,3 @@ library L
}
}
// ----
// TypeError: (27-58): Type is required to live outside storage.
// TypeError: (60-91): Type is required to live outside storage.
// TypeError: (121-150): Type is required to live outside storage.
@@ -2,5 +2,5 @@ contract c {
function f1(mapping(uint => uint) calldata) pure external returns (mapping(uint => uint) memory) {}
}
// ----
// TypeError: (29-59): Type is required to live outside storage.
// TypeError: (29-59): Internal or recursive type is not allowed for public or external functions.
// 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.
@@ -2,5 +2,4 @@ contract c {
function f3(mapping(uint => uint) memory) view public {}
}
// ----
// TypeError: (29-57): Type is required to live outside storage.
// TypeError: (29-57): Internal or recursive type is not allowed for public or external functions.
// TypeError: (29-57): Mapping types for parameters or return variables can only be used in internal or library functions.
@@ -3,5 +3,4 @@ contract C {
}
}
// ----
// TypeError: (51-79): Type is required to live outside storage.
// TypeError: (51-79): Internal or recursive type is not allowed for public or external functions.
// TypeError: (51-79): Mapping types for parameters or return variables can only be used in internal or library functions.