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
Currently, parametricity is violated because we can pattern-match on anything, including abstract types, thereby retrieving information that should not have been accessible.
We can easily fix this by requiring pattern matching scrutinees to be subtypes of some "matchable" upper bound which all concrete types subtype (but not type parameters).
Note: Another advantage of Object is that it will allow us to cleanly separate primitive types, such as primitive integers, which have their own binary representation (in WASM), from object types. The two are distinct and should not be mixed in pattern matching expressions.
Currently, parametricity is violated because we can pattern-match on anything, including abstract types, thereby retrieving information that should not have been accessible.
We can easily fix this by requiring pattern matching scrutinees to be subtypes of some "matchable" upper bound which all concrete types subtype (but not type parameters).
This is similar to Scala 3's
Matchable
type (https://docs.scala-lang.org/scala3/reference/other-new-features/matchable.html).The text was updated successfully, but these errors were encountered: