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
More precise type for typed patterns, less precise for literal patterns
In `x @ Nil`, `Nil` is a _stable identifier pattern_ and will be compiled
to an `==` test, so the type of `x` is unrelated to the type of `Nil`.
This was handled correctly before this commit, but the check to use the
moe restrictive patten typing was too wide and also included typed
patterns like `x: Nil.type`, even though such patterns compile to `eq`
tests and therefore it's safe to assume that `x` has type `Nil.type`.
Additionally, a _literal pattern_ will also be compiled to an `==` test
and therefore should be less precisely typed, like a stable identifier
patterns.
0 commit comments