Skip to content

Commit a40df05

Browse files
committed
Implicits#viewExists: return false after typer instead of AssertionError
This way, tpd#applyOverloaded can safely be used after typer. This issue was encoutered while working on value classes, step 3 of SIP-15 contains the following peephole optimization: new C(e) == new C(f) => e == f Which requires us to do overloading resolution.
1 parent c5d8cba commit a40df05

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ trait Implicits { self: Typer =>
380380
override def viewExists(from: Type, to: Type)(implicit ctx: Context): Boolean = (
381381
!from.isError
382382
&& !to.isError
383+
&& !ctx.isAfterTyper
383384
&& (ctx.mode is Mode.ImplicitsEnabled)
384385
&& { from.widenExpr match {
385386
case from: TypeRef if defn.ScalaValueClasses contains from.symbol =>

0 commit comments

Comments
 (0)