Skip to content

Commit 8c3fc97

Browse files
committed
Fix #7428: Don't make enum values JavaStatic
It leads to backend crashes if the enum is defined in a class and does not seem to be needed anyway.
1 parent 42e3ad4 commit 8c3fc97

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/src/dotty/tools/dotc/core/Flags.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ object Flags {
526526
val DeferredOrLazyOrMethod: FlagSet = Deferred | Lazy | Method
527527
val DeferredOrTermParamOrAccessor: FlagSet = Deferred | ParamAccessor | TermParam // term symbols without right-hand sides
528528
val DeferredOrTypeParam: FlagSet = Deferred | TypeParam // type symbols without right-hand sides
529-
val EnumValue: FlagSet = Enum | JavaStatic | StableRealizable // A Scala enum value
529+
val EnumValue: FlagSet = Enum | StableRealizable // A Scala enum value
530530
val StableOrErased: FlagSet = Erased | StableRealizable // Assumed to be pure
531531
val ExtensionMethod: FlagSet = Extension | Method
532532
val FinalOrInline: FlagSet = Final | Inline

tests/pos/i7428.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object ABug
2+
enum Tag
3+
case first
4+
import Tag.first
5+
val xx = first
6+

0 commit comments

Comments
 (0)