Skip to content

Make IR breaking changes public. #11090

@bshastry

Description

@bshastry

Description

contract A {
    uint x;
    constructor() {
        x = 42;
    }
    function f() public returns(uint256) {
        return x;
    }
}
contract B is A {
    uint public y = f();
    function g() public returns(uint256) {
        return y;
    }
}
// ----
// constructor() ->
// y() -> 0
// g() -> 0
// f() -> 0x2a

passes but it should not. What should not pass is the y() -> 0 and g() -> 0 parts. They should both equal 0x2a.

Funnily enough, this test reports correct results via yul i.e., new code gen. We already have a semantic test for it here (only for new code gen and ewasm) https://github.com/ethereum/solidity/blob/develop/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol

Environment

  • Compiler version: 23f03e1
  • Target EVM version (as per compiler settings): Berlin
  • EVM execution environment / backend / blockchain client: evm v0.4.0

Steps to Reproduce

$ isoltest -t test

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions