diff --git a/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt b/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt index 7d56224af85..ac22f824c51 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/analyzer/AnalyzerFacade.kt @@ -97,10 +97,6 @@ public trait ModuleInfo { public enum class DependenciesOnBuiltins : DependencyOnBuiltins { - override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList) { - //TODO: KT-5457 - } - NONE { override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList) { //do nothing @@ -111,6 +107,11 @@ public trait ModuleInfo { dependencies.add(builtinsModule) } } + + override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList) { + //TODO: KT-5457 + } + } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index c2314d8fab7..0bc966d7255 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -740,45 +740,48 @@ public class JetParsing extends AbstractJetParsing { /* * enumClassBody - * : "{" (enumEntry | memberDeclaration)* "}" + * : "{" enumEntries members "}" * ; */ private void parseEnumClassBody() { if (!at(LBRACE)) return; - PsiBuilder.Marker classBody = mark(); - + PsiBuilder.Marker body = mark(); myBuilder.enableNewlines(); + advance(); // LBRACE + parseEnumEntries(); + parseMembers(); + + expect(RBRACE, "Expecting '}' to close enum class body"); + myBuilder.restoreNewlinesState(); + body.done(CLASS_BODY); + } + + /** + * enumEntries + * : enumEntry* + * ; + */ + private void parseEnumEntries() { while (!eof() && !at(RBRACE)) { - PsiBuilder.Marker entryOrMember = mark(); + PsiBuilder.Marker entry = mark(); ModifierDetector detector = new ModifierDetector(); parseModifierList(detector, ONLY_ESCAPED_REGULAR_ANNOTATIONS); - IElementType type; + // ?: how can we find ourselves at SOFT_KEYWORDS_AT_MEMBER_START if we are at identifier? + // Or, is it just for performance? if (!atSet(SOFT_KEYWORDS_AT_MEMBER_START) && at(IDENTIFIER)) { parseEnumEntry(); - type = ENUM_ENTRY; + closeDeclarationWithCommentBinders(entry, ENUM_ENTRY, true); } else { - type = parseMemberDeclarationRest(detector.isEnumDetected(), detector.isDefaultDetected()); - } - - if (type == null) { - errorAndAdvance("Expecting an enum entry or member declaration"); - entryOrMember.drop(); - } - else { - closeDeclarationWithCommentBinders(entryOrMember, type, true); + entry.rollbackTo(); + break; } } - - expect(RBRACE, "Expecting '}' to close enum class body"); - myBuilder.restoreNewlinesState(); - - classBody.done(CLASS_BODY); } /* @@ -808,7 +811,7 @@ public class JetParsing extends AbstractJetParsing { /* * classBody - * : ("{" memberDeclaration* "}")? + * : ("{" members "}")? * ; */ private void parseClassBody() { @@ -817,12 +820,7 @@ public class JetParsing extends AbstractJetParsing { myBuilder.enableNewlines(); if (expect(LBRACE, "Expecting a class body")) { - while (!eof()) { - if (at(RBRACE)) { - break; - } - parseMemberDeclaration(); - } + parseMembers(); expect(RBRACE, "Missing '}"); } @@ -831,6 +829,20 @@ public class JetParsing extends AbstractJetParsing { body.done(CLASS_BODY); } + /** + * members + * : memberDeclaration* + * ; + */ + private void parseMembers() { + while (!eof()) { + if (at(RBRACE)) { + break; + } + parseMemberDeclaration(); + } + } + /* * memberDeclaration * : modifiers memberDeclaration' diff --git a/compiler/testData/codegen/box/enum/abstractNestedClass.kt b/compiler/testData/codegen/box/enum/abstractNestedClass.kt index 31328c77d5c..d6e015f56b3 100644 --- a/compiler/testData/codegen/box/enum/abstractNestedClass.kt +++ b/compiler/testData/codegen/box/enum/abstractNestedClass.kt @@ -1,7 +1,7 @@ enum class E { - abstract class Nested - ENTRY + + abstract class Nested } fun box(): String { diff --git a/compiler/testData/codegen/box/secondaryConstructors/enums.kt b/compiler/testData/codegen/box/secondaryConstructors/enums.kt index 5c88c89f8d2..d7ae1b9817d 100644 --- a/compiler/testData/codegen/box/secondaryConstructors/enums.kt +++ b/compiler/testData/codegen/box/secondaryConstructors/enums.kt @@ -19,13 +19,13 @@ enum class A1(val prop1: String) { } enum class A2 { - val prop1: String X: A2("asd") Y: A2() { override fun f() = super.f() + "#Y" } Z: A2(5) + val prop1: String val prop2: String = "const2" var prop3: String = "" diff --git a/compiler/testData/psi/EnumNoAnnotations.kt b/compiler/testData/psi/EnumNoAnnotations.kt new file mode 100644 index 00000000000..ddd63420397 --- /dev/null +++ b/compiler/testData/psi/EnumNoAnnotations.kt @@ -0,0 +1,11 @@ +package a.b.c.test.enum + +enum class Enum { + // We have six entries in the following line, + // not one entry with five annotations + A B C D E F { + override fun f() = 4 + } + + open fun f() = 3 +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumNoAnnotations.txt b/compiler/testData/psi/EnumNoAnnotations.txt new file mode 100644 index 00000000000..61405adde4f --- /dev/null +++ b/compiler/testData/psi/EnumNoAnnotations.txt @@ -0,0 +1,100 @@ +JetFile: EnumNoAnnotations.kt + PACKAGE_DIRECTIVE + PsiElement(package)('package') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('c') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('test') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('enum') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Enum') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + PsiComment(EOL_COMMENT)('// We have six entries in the following line,') + PsiWhiteSpace('\n ') + PsiComment(EOL_COMMENT)('// not one entry with five annotations') + PsiWhiteSpace('\n ') + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('D') + PsiWhiteSpace(' ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('E') + PsiWhiteSpace(' ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('F') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FUN + MODIFIER_LIST + PsiElement(override)('override') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('4') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + FUN + MODIFIER_LIST + PsiElement(open)('open') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('3') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/at/enumEntries.txt b/compiler/testData/psi/annotation/at/enumEntries.txt index e7d36eb1b43..742f25c1e1b 100644 --- a/compiler/testData/psi/annotation/at/enumEntries.txt +++ b/compiler/testData/psi/annotation/at/enumEntries.txt @@ -133,17 +133,20 @@ JetFile: enumEntries.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Ann') - PsiErrorElement:Expecting an enum entry or member declaration + PsiErrorElement:Expecting member declaration PsiElement(LPAR)('(') - PsiErrorElement:Expecting an enum entry or member declaration + PsiErrorElement:Expecting member declaration PsiElement(RPAR)(')') PsiWhiteSpace(' ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('W') - PsiWhiteSpace('\n\n ') FUN MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('W') + PsiWhiteSpace('\n\n ') ANNOTATION_ENTRY PsiElement(AT)('@') CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/secondaryConstructors/enumParsing.kt b/compiler/testData/psi/secondaryConstructors/enumParsing.kt index ef210829871..e99add9657c 100644 --- a/compiler/testData/psi/secondaryConstructors/enumParsing.kt +++ b/compiler/testData/psi/secondaryConstructors/enumParsing.kt @@ -1,13 +1,12 @@ enum class A { - constructor(x: Int) {} - abc1 : A(1,2,3) abc2 : A(1,2,3) {} + abc3 + + constructor(x: Int) {} init {} - abc3 - constructor(x: Int): this() {} init { diff --git a/compiler/testData/psi/secondaryConstructors/enumParsing.txt b/compiler/testData/psi/secondaryConstructors/enumParsing.txt index dc8290280ab..81353373e85 100644 --- a/compiler/testData/psi/secondaryConstructors/enumParsing.txt +++ b/compiler/testData/psi/secondaryConstructors/enumParsing.txt @@ -12,27 +12,6 @@ JetFile: enumParsing.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - SECONDARY_CONSTRUCTOR - PsiElement(constructor)('constructor') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - CONSTRUCTOR_DELEGATION_CALL - CONSTRUCTOR_DELEGATION_REFERENCE - - BLOCK - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('abc1') @@ -92,6 +71,31 @@ JetFile: enumParsing.kt CLASS_BODY PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('abc3') + PsiWhiteSpace('\n\n ') + SECONDARY_CONSTRUCTOR + PsiElement(constructor)('constructor') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CONSTRUCTOR_DELEGATION_CALL + CONSTRUCTOR_DELEGATION_REFERENCE + + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') ANONYMOUS_INITIALIZER PsiElement(init)('init') @@ -100,10 +104,6 @@ JetFile: enumParsing.kt PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('abc3') - PsiWhiteSpace('\n\n ') SECONDARY_CONSTRUCTOR PsiElement(constructor)('constructor') VALUE_PARAMETER_LIST diff --git a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java index df98fd5de9a..8014ab56fab 100644 --- a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java @@ -205,6 +205,12 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } + @TestMetadata("EnumNoAnnotations.kt") + public void testEnumNoAnnotations() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumNoAnnotations.kt"); + doParsingTest(fileName); + } + @TestMetadata("Enums.kt") public void testEnums() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/Enums.kt"); diff --git a/grammar/src/class.grm b/grammar/src/class.grm index 7449b3a5710..b1b5e2fd040 100644 --- a/grammar/src/class.grm +++ b/grammar/src/class.grm @@ -25,7 +25,11 @@ class classBody - : ("{" memberDeclaration* "}")? + : ("{" members "}")? + ; + +members + : memberDeclaration* ; delegationSpecifier diff --git a/grammar/src/enum.grm b/grammar/src/enum.grm index bfe40f51e99..2aa25b2c426 100644 --- a/grammar/src/enum.grm +++ b/grammar/src/enum.grm @@ -5,7 +5,11 @@ See [Enum classes](enum-classes.html) */ enumClassBody - : "{" (enumEntry | memberDeclaration)* "}" + : "{" enumEntries members "}" + ; + +enumEntries + : enumEntry* ; enumEntry diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt index a10157badd7..dd966f172a7 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt @@ -1,12 +1,6 @@ // PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction // OPTIONS: usages enum class E { - init { - foo(1) - } - - open fun foo(n: Int): Int = n - O A { init { @@ -22,4 +16,10 @@ enum class E { override fun foo(n: Int): Int = n + 2 } + + init { + foo(1) + } + + open fun foo(n: Int): Int = n } diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.results.txt b/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.results.txt index a0a5b652b09..d06564f35f8 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.results.txt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.results.txt @@ -1,3 +1,3 @@ -Function call (13: 13) foo(1) -Function call (20: 13) foo(1) -Function call (5: 9) foo(1) \ No newline at end of file +Function call (14: 13) foo(1) +Function call (21: 9) foo(1) +Function call (7: 13) foo(1) \ No newline at end of file diff --git a/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt b/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt index d84ec812139..6db26124a6e 100644 --- a/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt +++ b/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt @@ -29,9 +29,9 @@ interface T1 // ----- enum class E1 { - object O7 - ENTRY + + object O7 } // ----- @@ -67,9 +67,9 @@ interface T2 // ----- enum class E2 { - object O14 {} - ENTRY + + object O14 {} } // ----- @@ -110,8 +110,8 @@ interface T3 // ----- enum class E3 { + ENTRY + object O21 { } - - ENTRY } diff --git a/idea/testData/formatter/EmptyLineAfterObjectDeclaration.kt b/idea/testData/formatter/EmptyLineAfterObjectDeclaration.kt index 75334e02322..58564f47b3b 100644 --- a/idea/testData/formatter/EmptyLineAfterObjectDeclaration.kt +++ b/idea/testData/formatter/EmptyLineAfterObjectDeclaration.kt @@ -24,8 +24,8 @@ interface T1 // ----- enum class E1 { - object O7 ENTRY + object O7 } // ----- @@ -56,8 +56,8 @@ interface T2 // ----- enum class E2 { - object O14 {} ENTRY + object O14 {} } // ----- @@ -93,7 +93,7 @@ interface T3 // ----- enum class E3 { + ENTRY object O21 { } - ENTRY } diff --git a/idea/testData/navigation/implementations/EnumEntriesInheritance.kt b/idea/testData/navigation/implementations/EnumEntriesInheritance.kt index 6689d56dfd5..92574d7a5c7 100644 --- a/idea/testData/navigation/implementations/EnumEntriesInheritance.kt +++ b/idea/testData/navigation/implementations/EnumEntriesInheritance.kt @@ -1,6 +1,4 @@ enum class E { - open fun foo(n: Int): Int = n - O A { override fun foo(n: Int): Int = n + 1 @@ -10,6 +8,8 @@ enum class E { override fun foo(n: Int): Int = n + 2 } + + open fun foo(n: Int): Int = n } // REF: (E).A diff --git a/idea/testData/navigation/implementations/OverridesInEnumEntries.kt b/idea/testData/navigation/implementations/OverridesInEnumEntries.kt index 02cc76cf132..3868e66e829 100644 --- a/idea/testData/navigation/implementations/OverridesInEnumEntries.kt +++ b/idea/testData/navigation/implementations/OverridesInEnumEntries.kt @@ -1,6 +1,4 @@ enum class E { - open fun foo(n: Int): Int = n - O A { override fun foo(n: Int): Int = n + 1 @@ -10,6 +8,8 @@ enum class E { override fun foo(n: Int): Int = n + 2 } + + open fun foo(n: Int): Int = n } // REF: (in E.A).foo(Int) diff --git a/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesAfter.kt b/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesAfter.kt index de37cc6936e..27e18ec0c12 100644 --- a/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesAfter.kt +++ b/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesAfter.kt @@ -1,6 +1,4 @@ enum class E { - open fun foo(n: Int, s: String): Int = n - O A { override fun foo(n: Int, s: String): Int = n + 1 @@ -10,4 +8,6 @@ enum class E { override fun foo(n: Int, s: String): Int = n + 2 } + + open fun foo(n: Int, s: String): Int = n } \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesBefore.kt b/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesBefore.kt index 9393077cf6f..df0752dbe31 100644 --- a/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesBefore.kt +++ b/idea/testData/refactoring/changeSignature/OverridesInEnumEntriesBefore.kt @@ -1,6 +1,4 @@ enum class E { - open fun foo(n: Int): Int = n - O A { override fun foo(n: Int): Int = n + 1 @@ -10,4 +8,6 @@ enum class E { override fun foo(n: Int): Int = n + 2 } + + open fun foo(n: Int): Int = n } \ No newline at end of file diff --git a/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/after/RenameKotlinFunctionInEnum.kt b/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/after/RenameKotlinFunctionInEnum.kt index 33d590c0c57..97439de0ada 100644 --- a/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/after/RenameKotlinFunctionInEnum.kt +++ b/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/after/RenameKotlinFunctionInEnum.kt @@ -1,8 +1,6 @@ package test enum class E { - open fun bar(n: Int): Int = n - O A { override fun bar(n: Int): Int = n + 1 @@ -12,4 +10,6 @@ enum class E { override fun bar(n: Int): Int = n + 2 } + + open fun bar(n: Int): Int = n } \ No newline at end of file diff --git a/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/before/RenameKotlinFunctionInEnum.kt b/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/before/RenameKotlinFunctionInEnum.kt index 1f776cf4b94..2088f3da586 100644 --- a/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/before/RenameKotlinFunctionInEnum.kt +++ b/idea/testData/refactoring/rename/renameKotlinFunctionInEnum/before/RenameKotlinFunctionInEnum.kt @@ -1,8 +1,6 @@ package test enum class E { - open fun foo(n: Int): Int = n - O A { override fun foo(n: Int): Int = n + 1 @@ -12,4 +10,6 @@ enum class E { override fun foo(n: Int): Int = n + 2 } + + open fun foo(n: Int): Int = n } \ No newline at end of file diff --git a/js/js.translator/testData/enum/cases/enumWithInheritance.kt b/js/js.translator/testData/enum/cases/enumWithInheritance.kt index 9c29ae94923..35e3f2b9de7 100644 --- a/js/js.translator/testData/enum/cases/enumWithInheritance.kt +++ b/js/js.translator/testData/enum/cases/enumWithInheritance.kt @@ -1,8 +1,6 @@ package foo enum class B(open val bar: Int) { - val x = 1 - var y = 12; a : B(0) { override val bar = 3 init { @@ -12,6 +10,8 @@ enum class B(open val bar: Int) { b : B(4) { } c : B(5) + val x = 1 + var y = 12; } trait X {