Currently it is possible to have a struct that has no mutability annotation (#[var(b)]):
struct A {
a: i32,
b: bool
}
Then take such a struct as mut param in a function:
fn f(mut a: A) {
a.b = false;
}
This is allowed but very dangerous because AntiAliasing in Scala Stainless will simply and silently erase the field assignments to non-var fields with Unit. This is fixed by https://github.com/epfl-lara/stainless/pull/1016.
Currently it is possible to have a struct that has no mutability annotation (
#[var(b)]
):Then take such a struct as
mut
param in a function:This is allowed but very dangerous because
AntiAliasing
in Scala Stainless will simply and silently erase the field assignments to non-var fields withUnit
. This is fixed by https://github.com/epfl-lara/stainless/pull/1016.