You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exclude mixin forwarders from double definition checks
With the new applied type scheme, we can generate mixin
forwarders for the same method at different base types
which end up with different types if the base types
have different type arguments. This can lead to spurious
"double definition with same erased type" failures, if
these instantiations do not have matching types.
if (isDefined(sym1) && isDefined(sym2) &&!info1.matchesLoosely(info2))
91
+
//The reason for the `isDefined` condition is that we need to exclude mixin forwarders
92
+
//from the tests. For instance, in compileStdLib, compiling scala.immutable.SetProxy, line 29:
93
93
// new AbstractSet[B] with SetProxy[B] { val self = newSelf }
94
-
// double definition:
94
+
// This generates two forwarders, one in AbstractSet, the other in the anonymous class itself.
95
+
// Their signatures are:
95
96
// method map: [B, That]
96
97
// (f: B => B)(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Set[B], B, That]): That override <method> <touched> in anonymous class scala.collection.AbstractSet[B] with scala.collection.immutable.SetProxy[B]{...} and
97
98
// method map: [B, That](f: B => B)(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.Set[B], B, That]): That override <method> <touched> in class AbstractSet
98
-
// have same type after erasure: (f: Function1, bf: scala.collection.generic.CanBuildFrom): Object
0 commit comments