Skip to content

Commit f2f4d91

Browse files
Check if owner is inline trait last
Calling .owner on some traits (for example HashUtils) results in an exception with the message "Cyclic reference involving trait HashTable". Using the short-circuiting of &&, checking for the owner symbol later solves this issue when bootstrapping.
1 parent 3f9147d commit f2f4d91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/PruneInlineTraits.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ class PruneInlineTraits extends MiniPhase with SymTransformer { thisTransform =>
3131
else tree
3232

3333
private def isEraseable(sym: SymDenotation)(using Context): Boolean =
34-
sym.owner.isInlineTrait
34+
!sym.isType
3535
&& !sym.isConstructor
3636
&& !sym.is(Param)
3737
&& !sym.is(ParamAccessor)
3838
&& !sym.is(Private)
3939
&& !sym.isLocalDummy
40-
&& !sym.isType
40+
&& sym.owner.isInlineTrait
4141
}
4242

4343
object PruneInlineTraits {

0 commit comments

Comments
 (0)