Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1036,10 +1036,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
// scala.AnyRef [Scala 3: which scala.Null conforms to], the type denotes the set of values consisting
// of null and the value denoted by p (i.e., the value v for which v eq p). [Otherwise,] the type
// denotes the set consisting of only the value denoted by p.
!ctx.explicitNulls && isNullable(tp.underlying) && tp.isStable
!ctx.mode.is(Mode.SafeNulls) && isNullable(tp.underlying) && tp.isStable
case tp: ThisType =>
// Same as above; this.type is also a singleton type in spec language
!ctx.explicitNulls && isNullable(tp.underlying)
!ctx.mode.is(Mode.SafeNulls) && isNullable(tp.underlying)
case tp: RefinedOrRecType => isNullable(tp.parent)
case tp: AppliedType => isNullable(tp.tycon)
case AndType(tp1, tp2) => isNullable(tp1) && isNullable(tp2)
Expand Down
Loading