solidity/test/libsolidity/syntaxTests/immutable/variable_declaration_value.sol
2022-04-01 23:41:18 -05:00

6 lines
208 B
Solidity

contract C {
int immutable x = x = 5;
}
// ----
// TypeError 1581: (35-36='x'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.