We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 032ef94 commit 004ddb3Copy full SHA for 004ddb3
compiler/src/dotty/tools/dotc/transform/CompleteJavaEnums.scala
@@ -115,7 +115,10 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
115
private def isJavaEnumValueImpl(cls: Symbol)(using Context): Boolean =
116
cls.isAnonymousClass
117
&& ((cls.owner.name eq nme.DOLLAR_NEW) || cls.owner.isAllOf(EnumCase))
118
- && cls.owner.owner.linkedClass.derivesFromJavaEnum
+ && {
119
+ val enumCls = cls.owner.owner.linkedClass
120
+ enumCls.derivesFromJavaEnum && enumCls.is(Enum)
121
+ }
122
123
/** 1. If this is an enum class, add $name and $ordinal parameters to its
124
* parameter accessors and pass them on to the java.lang.Enum constructor.
0 commit comments