Skip to content

Commit b686a05

Browse files
committed
Fast path for ByNameClass in isImpossibleSubtype
These show up often due to the way that searches for implicit views operate: firstly `A=>B` is sought, and failing that `(=>A) => B`.
1 parent e5ccdb0 commit b686a05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/scala/tools/nsc/typechecker/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ trait Implicits {
564564
// side is a class, else we may not know enough.
565565
case tr1 @ TypeRef(_, sym1, _) if sym1.isClass =>
566566
tp2.dealiasWiden match {
567-
case TypeRef(_, sym2, _) => sym2.isClass && !(sym1 isWeakSubClass sym2)
567+
case TypeRef(_, sym2, _) => ((sym1 eq ByNameParamClass) != (sym2 eq ByNameParamClass)) || (sym2.isClass && !(sym1 isWeakSubClass sym2))
568568
case RefinedType(parents, decls) => decls.nonEmpty && tr1.member(decls.head.name) == NoSymbol
569569
case _ => false
570570
}

0 commit comments

Comments
 (0)