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

9 lines
257 B
Solidity

contract A {
int immutable a;
constructor() { a = 5; }
function f() public { --a; }
}
// ----
// TypeError 1581: (85-86='a'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.