Fixing ICE when returning Struct from library

This commit is contained in:
Djordje Mijovic
2020-10-13 20:00:11 +02:00
committed by chriseth
parent 44dc668777
commit 1272c474ba
4 changed files with 31 additions and 5 deletions
@@ -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