From 0cf96cc4851fe094563640dbde53b4adbe6ea4b7 Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Fri, 13 May 2022 14:34:05 -0400 Subject: [PATCH] Remove special eq in unsafeNulls --- compiler/src/dotty/tools/dotc/typer/Typer.scala | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index a13ea88f14e7..ec2781d8948d 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -643,19 +643,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer def typeSelectOnTerm(using Context): Tree = val qual = typedExpr(tree.qualifier, shallowSelectionProto(tree.name, pt, this)) - val qual1 = if Nullables.unsafeNullsEnabled then - qual.tpe match { - case OrNull(tpe1) if tpe1 <:< defn.ObjectType => - qual.cast(AndType(qual.tpe, tpe1)) - case tp => - if tp.isNullType - && (tree.name == nme.eq || tree.name == nme.ne) then - // Allow selecting `eq` and `ne` on `Null` specially - qual.cast(defn.ObjectType) - else qual - } - else qual - typedSelect(tree, pt, qual1).withSpan(tree.span).computeNullable() + typedSelect(tree, pt, qual).withSpan(tree.span).computeNullable() def javaSelectOnType(qual: Tree)(using Context) = // semantic name conversion for `O$` in java code