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
2270
2270
}
2271
2271
}
2272
2272
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
+ */
2273
2279
protected def checkEqualityEvidence (tree : tpd.Tree , pt : Type )(implicit ctx : Context ) : Unit = {
2274
2280
tree match {
2275
2281
case _ : RefTree | _ : Literal
@@ -2279,7 +2285,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
2279
2285
untpd.Apply (
2280
2286
untpd.Select (untpd.TypedSplice (tree), nme.EQ ),
2281
2287
untpd.TypedSplice (dummyTreeOfType(pt)))
2282
- typedExpr(cmp, defn.BooleanType )(ctx.retractMode( Mode . Pattern ))
2288
+ typedExpr(cmp, defn.BooleanType )
2283
2289
case _ =>
2284
2290
}
2285
2291
}
You can’t perform that action at this time.
0 commit comments