Skip to content

Commit 7bbc6ad

Browse files
committed
Remove multiversal variants of ==
Map them to Any_==, which is the only method supported by the backend.
1 parent 2b368c9 commit 7bbc6ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dotty/tools/dotc/transform/InterceptedMethods.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class InterceptedMethods extends MiniPhaseTransform {
100100
lazy val Select(qual, _) = tree.fun
101101
val Any_## = this.Any_##
102102
val Any_!= = defn.Any_!=
103+
val Any_null_== = defn.Any_null_==
103104
val rewrite: Tree = tree.fun.symbol match {
104105
case Any_## =>
105106
poundPoundValue(qual)
@@ -113,6 +114,8 @@ class InterceptedMethods extends MiniPhaseTransform {
113114
List(qual, typer.resolveClassTag(tree.pos, qual.tpe.widen))))
114115
}*/
115116
*/
117+
case Any_null_== =>
118+
qual.select(defn.Any_==).appliedToArgs(tree.args)
116119
case t if primitiveGetClassMethods.contains(t) =>
117120
// if we got here then we're trying to send a primitive getClass method to either
118121
// a) an Any, in which cage Object_getClass works because Any erases to object. Or
@@ -123,6 +126,8 @@ class InterceptedMethods extends MiniPhaseTransform {
123126
// so we need replace that method name with Object_getClass to get correct behavior.
124127
// See SI-5568.
125128
qual.selectWithSig(defn.Any_getClass).appliedToNone
129+
case t if t.name == nme.EQ && t.owner == defn.NullClass =>
130+
qual.select(defn.Any_==).appliedToArgs(tree.args)
126131
case _ =>
127132
tree
128133
}

0 commit comments

Comments
 (0)