-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Open
Labels
Description
Page
https://docs.soliditylang.org/en/v0.8.30/ir-breaking-changes.html#semantic-only-changes
Abstract
In the "Semantic only changes" section, the order for initialization of contracts for the old codegen lists "Evaluate base constructor arguments" before "Initialize state variables":
The order used to be:
All state variables are zero-initialized at the beginning.
Evaluate base constructor arguments from most derived to most base contract.
Initialize all state variables in the whole inheritance hierarchy from most base to most derived.
This seems inconsistent with the compiler behavior. The documentation suggests that for the following sample the value of b should be 0, instead its 13:
contract Base {
uint a = 13;
uint public b;
constructor(uint x) public {
b = x;
}
}
contract Child is Base {
constructor() Base(a) public {
}
}The documentation seems correct for the IR codegen path.