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
And demonstrate that the current scheme of generating mixin forwarders
before erasure is broken:
- Because they're generated before erasure, their erasure in the class
where their defined might differ from the erasure of the method they
forward to. This is normally OK since they'll get a bridge.
- However, mixin forwarders can clash with other methods as demonstrated
by neg/mixin-forwarder-clash1, but these clashes won't be detected
under separate compilation since double-defs checks are only done
based on the signature of methods where they're defined, so
neg/mixin-forwarder-clash2 fails.
Checking for clashes against the signatures of all possible forwarders
would be really annoying and possibly expensive, so instead the next
commit solves this issue by moving mixin forwarder generation after
erasure.
if (isDefined(sym1) && isDefined(sym2) &&!info1.matchesLoosely(info2))
94
-
// The reason for the `isDefined` condition is that we need to exclude mixin forwarders
95
-
// from the tests. For instance, in compileStdLib, compiling scala.immutable.SetProxy, line 29:
96
-
// new AbstractSet[B] with SetProxy[B] { val self = newSelf }
97
-
// This generates two forwarders, one in AbstractSet, the other in the anonymous class itself.
98
-
// Their signatures are:
99
-
// method map: [B, That]
100
-
// (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
101
-
// 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
0 commit comments