File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments