solidity/test/libsolidity/syntaxTests/immutable/inheritance_wrong_ctor.sol

13 lines
309 B
Solidity
Raw Normal View History

2020-03-10 17:15:50 +00:00
contract B {
uint immutable x = 4;
}
contract C is B {
2020-06-23 12:14:24 +00:00
constructor() {
2020-03-10 17:15:50 +00:00
x = 3;
}
}
// ----
2020-06-23 12:14:24 +00:00
// TypeError 7484: (88-89): Immutable variables must be initialized in the constructor of the contract they are defined in.
// TypeError 1574: (88-89): Immutable state variable already initialized.