mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test with storage struct containing external function.
This commit is contained in:
parent
1f3239d097
commit
26cf6f189d
@ -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
|
Loading…
Reference in New Issue
Block a user