State var can be used to initialize itself
leonardoalt opened this issue · comments
Leo commented
constructor of LValue
interface constructor()
creates
uint x := x
invariants
x == 0
This is accepted by parse/type/prove.
The invariant is false (any expression you put there), since I guess x
is unconstrained initially.
I guess this should be disallowed in general?
dxo commented
I think lets just disallow storage references on the RHS of assignment expressions in the creates block for now, we can reindtroduce them later (probably with some kind of cycle detection?)
MrChico commented
Yeah, that sounds reasonable. A variable on RHS in the constructor would always be empty, anyway