solidity/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol

23 lines
389 B
Solidity
Raw Normal View History

contract D {
uint public x;
constructor(function() external pure returns (uint) g) {
x = g();
}
}
contract C {
function f() public returns (uint r) {
D d = new D(this.sixteen);
r = d.x();
}
function sixteen() public pure returns (uint) {
return 16;
}
}
// ====
// compileViaYul: also
// ----
// f() -> 16
2021-02-12 12:45:15 +00:00
// gas legacy: 104744