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
importstainless.lang._importstainless.annotation._objectGhostMatch {
caseclassFoo(@ghost value: Option[BigInt])
defnonGhostMatch(foo: Foo) = {
foo match { // should fail because foo.value will not exist at runtimecaseFoo(Some(a)) =>truecaseFoo(_) =>false
}
}
@ghost
defghostMatch(foo: Foo) = {
foo match { // this is okay because we are in ghost contextcaseFoo(Some(a)) =>truecaseFoo(_) =>false
}
}
}
The text was updated successfully, but these errors were encountered:
importstainless.lang._importstainless.annotation._objectGhostMatch {
caseclassFoo(@ghost value: Option[Int])
defnonGhostMatch(foo: Foo):Int= {
foo match { // should fail because foo.value will not exist at runtimecaseFoo(Some(a)) =>1caseFoo(_) =>0
}
}
@ghost
defghostMatch(foo: Foo) = {
foo match { // this is okay because we are in ghost contextcaseFoo(Some(a)) =>truecaseFoo(_) =>false
}
}
@cCode.exportdeftest():Int= {
nonGhostMatch(Foo(Some[Int](3)))
}
@extern
defmain(args: Array[String]):Unit= test
}
The text was updated successfully, but these errors were encountered: