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
Consider you have some partly-collapsing variable x: Ref[A]|B which through reference collapsing always acts as A|B.
Assume we want to check / assert that x actually is a Ref[A]. This is currently impossible, because in if x is Ref[A] { ... } also x acts as A|B, so this would in general by false.
The same goes for assert(x is Ref[A]).
Instead, you must check for if x is A { ... }.
This doesn't work for x: Ref[A]|A though.
A (ugly) workaround is to use the complementary check, i.e. if not(x is B) { ... }.
The text was updated successfully, but these errors were encountered:
Consider you have some partly-collapsing variable
x: Ref[A]|B
which through reference collapsing always acts asA|B
.Assume we want to check / assert that
x
actually is aRef[A]
. This is currently impossible, because inif x is Ref[A] { ... }
alsox
acts asA|B
, so this would in general by false.The same goes for
assert(x is Ref[A])
.Instead, you must check for
if x is A { ... }
.This doesn't work for
x: Ref[A]|A
though.A (ugly) workaround is to use the complementary check, i.e.
if not(x is B) { ... }
.The text was updated successfully, but these errors were encountered: