Skip to content

Commit 6c92fbe

Browse files
committed
only try NamedType compatibility for ApplyingProto
1 parent 0d5388f commit 6c92fbe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ object ProtoTypes {
4141
/** Test compatibility after normalization in a fresh typerstate. */
4242
def normalizedCompatible(tp: Type, pt: Type)(implicit ctx: Context) = ctx.typerState.test {
4343
val normTp = normalize(tp, pt)
44-
isCompatible(normTp, pt) || pt.isRef(defn.UnitClass) && normTp.isParameterless || isCompatible(tp, pt)
44+
isCompatible(normTp, pt) ||
45+
pt.isRef(defn.UnitClass) && normTp.isParameterless ||
46+
pt.isInstanceOf[ApplyingProto] && isCompatible(tp, pt) // check i3352
4547
}
4648

4749
private def disregardProto(pt: Type)(implicit ctx: Context): Boolean = pt.dealias match {
@@ -102,7 +104,7 @@ object ProtoTypes {
102104
def qualifies(m: SingleDenotation) =
103105
memberProto.isRef(defn.UnitClass) ||
104106
compat.normalizedCompatible(m.info, memberProto) ||
105-
compat.normalizedCompatible(m.namedType, memberProto)
107+
memberProto.isInstanceOf[ApplyingProto] && compat.normalizedCompatible(m.namedType, memberProto) // check i3352
106108
mbr match { // hasAltWith inlined for performance
107109
case mbr: SingleDenotation => mbr.exists && qualifies(mbr)
108110
case _ => mbr hasAltWith qualifies

0 commit comments

Comments
 (0)