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
BUG: The use of isDerivedValueClass in ExtensionMethods causes cyclic references
In scala#411 I implemented value classes and started getting errors in the
backend. This commit reproduces similar errors in master with a single
change: In master Symbol#isDerivedValueClass always return false because
value classes are non-functional, after this commit it still always
return false but it calls this.derivesFrom(defn.AnyValClass) first, this
is enough to trigger the problem.
Here's what's happening with dotc_reporter for example, the first error
is:
dotty.tools.dotc.core.Types$CyclicReference: cyclic reference involving class FlatHashTable
- During Erasure, isDerivedValueClass is called on the class FlatHashTable
- derivesFrom forces the computation of the base classes of FlatHashTable
- HashUtils is a parent of FlatHashTable, its denotation is forced
- HashUtils is then transformed by ExplicitOuter which calls isStatic on it
- isStatic calls owner.isStaticOwner, this forces the denotation of the owner
of HashUtils, which is the module class FlatHashTable$
- FlatHashTable$ is then transformed by ExtensionMethods which calls linkedClass
on it to get the companion class FlatHashTable
- isDerivedValueClass is called on the class FlatHashTable
- *BOOM*
0 commit comments