You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet is marked as invalid even though it is not:
importstainless.lang._importstainless.annotation._objectVarVarBinks {
sealedtraitOptionMut[@mutable T] {
defisDefined:Boolean=thismatch {
caseSomeMut(_) =>truecaseNoneMut() =>false
}
defget:T= {
require(isDefined)
thismatch {
caseSomeMut(v) => v
}
}
}
// Note: v is not a var!caseclassSomeMut[@mutable T](v: T) extendsOptionMut[T]
caseclassNoneMut[@mutable T]() extendsOptionMut[T]
caseclassC1(varf2:OptionMut[C2])
caseclassC2(varf3:OptionMut[C3])
caseclassC3(varv:BigInt)
deftest(x: BigInt):BigInt= {
valc1=C1(NoneMut())
c1.f2 =SomeMut(C2(NoneMut()))
c1.f2.get.f3 =SomeMut(C3(x))
c1.f2.get.f3.get.v // precond to f3.get is invalid
}
}
This is due to the field of SomeMut (v) being a val (declaring it a var makes the last expression go through as expected).
It seems that AntiAliasing is not correctly handling the update for c1.f2.get.f3 due to v not being a var.
The text was updated successfully, but these errors were encountered:
The following snippet is marked as invalid even though it is not:
This is due to the field of
SomeMut
(v
) being aval
(declaring it avar
makes the last expression go through as expected).It seems that
AntiAliasing
is not correctly handling the update forc1.f2.get.f3
due tov
not being avar
.The text was updated successfully, but these errors were encountered: