Test with storage struct containing external function.

This commit is contained in:
chriseth 2020-11-03 11:47:08 +01:00
parent 1f3239d097
commit 26cf6f189d

View File

@ -0,0 +1,34 @@
struct S {
uint16 a;
function() external returns (uint) x;
uint16 b;
}
contract Flow {
S[2] t;
function X() public pure returns (uint) {
return 1;
}
function Y() public pure returns (uint) {
return 2;
}
constructor() {
t[0].a = 0xff07;
t[0].b = 0xff07;
t[1].x = this.Y;
t[1].a = 0xff07;
t[1].b = 0xff07;
t[0].x = this.X;
}
function f() public returns (uint, uint) {
return (t[0].x(), t[1].x());
}
}
// ====
// compileViaYul: also
// ----
// f() -> 1, 2