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
/* Curious case of Egg invariant. When a class is defined inside a method, the context is captured inside an invariant. If this context is mutable and is changed before class declaration, the captured check is wrong and an attempt to construct class instance fails. The context should probably not be captured when there is no syntactic dependency. If there is a syntactic dependency that is mutable, probably we should just throw unless there is a clear way to handle such mutable context.*/importstainless.lang.*importstainless.annotation.*importStaticChecks.*objectEggInvariant {
caseclassMut(varx:Int)
deftest= {
valm=Mut(2)
m.x =1
assert(m.x ==1)
finalcaseclassEgg(n: Int)
Egg(3)
}
}
The generated invariant is:
The text was updated successfully, but these errors were encountered: