@@ -1813,6 +1813,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1813
1813
|| symInfo.isInstanceOf [MethodType ]
1814
1814
&& symInfo.signature.consistentParams(info2.signature)
1815
1815
1816
+ def tp1IsSingleton : Boolean = tp1.isInstanceOf [SingletonType ]
1817
+
1816
1818
// A relaxed version of isSubType, which compares method types
1817
1819
// under the standard arrow rule which is contravarient in the parameter types,
1818
1820
// but under the condition that signatures might have to match (see sigsOK)
@@ -1827,8 +1829,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
1827
1829
matchingMethodParams(info1, info2, precise = false )
1828
1830
&& isSubInfo(info1.resultType, info2.resultType.subst(info2, info1), symInfo1.resultType)
1829
1831
&& 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) }
1832
1834
1833
1835
val info1 = m.info.widenExpr
1834
1836
isSubInfo(info1, tp2.refinedInfo.widenExpr, m.symbol.info.orElse(info1))
0 commit comments