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

6 lines
204 B
Solidity
Raw Normal View History

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