@@ -1813,6 +1813,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
18131813 || symInfo.isInstanceOf [MethodType ]
18141814 && symInfo.signature.consistentParams(info2.signature)
18151815
1816+ def tp1IsSingleton : Boolean = tp1.isInstanceOf [SingletonType ]
1817+
18161818 // A relaxed version of isSubType, which compares method types
18171819 // under the standard arrow rule which is contravarient in the parameter types,
18181820 // but under the condition that signatures might have to match (see sigsOK)
@@ -1827,8 +1829,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
18271829 matchingMethodParams(info1, info2, precise = false )
18281830 && isSubInfo(info1.resultType, info2.resultType.subst(info2, info1), symInfo1.resultType)
18291831 && sigsOK(symInfo1, info2)
1830- case _ => isSubType(info1, info2)
1831- case _ => isSubType(info1, info2)
1832+ case _ => inFrozenGadtIf(tp1IsSingleton) { isSubType(info1, info2) }
1833+ case _ => inFrozenGadtIf(tp1IsSingleton) { isSubType(info1, info2) }
18321834
18331835 val info1 = m.info.widenExpr
18341836 isSubInfo(info1, tp2.refinedInfo.widenExpr, m.symbol.info.orElse(info1))
0 commit comments