solidity/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol
Daniel Kirchner 44da8507b1 Change default EVM version to Shanghai.
Co-authored-by: Rodrigo Q. Saramago <rodrigoqsaramago@gmail.com>
2023-05-08 16:34:23 +02:00

21 lines
358 B
Solidity

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;
}
}
// ----
// f() -> 16
// gas legacy: 102040