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
Fix#17467: Limit isNullable widening to stable TermRefs.
The Scala language specification has a peculiar clause about the
nullness of singleton types of the form `path.type`. It says that
`Null <:< path.type` if the *underlying* type `U` of `path` is
nullable itself.
The previous implementation of that rule was overly broad, as it
indiscrimately widened all types. This resulted in problematic
subtyping relationships like `Null <:< "foo"`.
We do not widen anymore. Instead, we specifically handle `TermRef`s
of stable members, which are how dotc represents singleton types.
We also have a rule for `Null <:< null`, which is necessary for
pattern matching exhaustivity to keep working in the presence of
nulls.
0 commit comments