mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9849 from ethereum/fixIce9817
Fixing ICE on returning struct with mapping from library
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
library Lib {
|
||||
struct Items {
|
||||
mapping (uint => uint) a;
|
||||
}
|
||||
|
||||
function get() public returns (Items storage x) {
|
||||
assembly { x.slot := 123 }
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f() public returns(uint256 slot) {
|
||||
Lib.Items storage ptr = Lib.get();
|
||||
assembly { slot := ptr.slot }
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// library: Lib
|
||||
// f() -> 123
|
||||
Reference in New Issue
Block a user