Skip to content

Commit 40a183a

Browse files
committed
Add a comment and remove extraneous retraction from context
1 parent c5acd99 commit 40a183a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,12 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
22702270
}
22712271
}
22722272

2273+
/** Check that `tree == x: pt` is typeable. Used when checking a pattern
2274+
* against a selector of type `pt`. This implementation accounts for
2275+
* user-defined definitions of `==`.
2276+
*
2277+
* Overwritten to no-op in ReTyper.
2278+
*/
22732279
protected def checkEqualityEvidence(tree: tpd.Tree, pt: Type)(implicit ctx: Context) : Unit = {
22742280
tree match {
22752281
case _: RefTree | _: Literal
@@ -2279,7 +2285,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
22792285
untpd.Apply(
22802286
untpd.Select(untpd.TypedSplice(tree), nme.EQ),
22812287
untpd.TypedSplice(dummyTreeOfType(pt)))
2282-
typedExpr(cmp, defn.BooleanType)(ctx.retractMode(Mode.Pattern))
2288+
typedExpr(cmp, defn.BooleanType)
22832289
case _ =>
22842290
}
22852291
}

0 commit comments

Comments
 (0)