diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 722bd20ea0b..45ff269127c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -196,11 +196,7 @@ public interface Errors { DiagnosticFactory0 CLASS_IN_SUPERTYPE_FOR_ENUM = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 TYPE_PARAMETERS_IN_ENUM = DiagnosticFactory0.create(ERROR); - DiagnosticFactory1 ENUM_ENTRY_SHOULD_BE_INITIALIZED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME); - DiagnosticFactory1 ENUM_ENTRY_ILLEGAL_TYPE = DiagnosticFactory1.create(ERROR); - DiagnosticFactory2 ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER = DiagnosticFactory2.create(WARNING, DECLARATION_NAME); - DiagnosticFactory1 ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR = DiagnosticFactory1.create(WARNING, DELEGATOR_SUPER_CALL); - DiagnosticFactory1 ENUM_ENTRY_AFTER_ENUM_MEMBER = DiagnosticFactory1.create(WARNING, DECLARATION_NAME); + DiagnosticFactory0 ENUM_ENTRY_SHOULD_BE_INITIALIZED = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 ENUM_CLASS_CONSTRUCTOR_CALL = DiagnosticFactory0.create(ERROR); // Sealed-specific diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index f1828cbb40a..27eff89bfe1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -228,8 +228,7 @@ public class DefaultErrorMessages { FQ_NAMES_IN_TYPES); MAP.put(CANNOT_INFER_VISIBILITY, "Cannot infer visibility for ''{0}''. Please specify it explicitly", COMPACT); - MAP.put(ENUM_ENTRY_SHOULD_BE_INITIALIZED, "Missing delegation specifier ''{0}''", NAME); - MAP.put(ENUM_ENTRY_ILLEGAL_TYPE, "The type constructor of enum entry should be ''{0}''", NAME); + MAP.put(ENUM_ENTRY_SHOULD_BE_INITIALIZED, "Enum has no default constructor, use 'entry(parameters)'"); MAP.put(UNINITIALIZED_VARIABLE, "Variable ''{0}'' must be initialized", NAME); MAP.put(UNINITIALIZED_PARAMETER, "Parameter ''{0}'' is uninitialized here", NAME); @@ -266,9 +265,6 @@ public class DefaultErrorMessages { MAP.put(DEPRECATED_SYMBOL_WITH_MESSAGE, "''{0}'' is deprecated. {1}", DEPRECATION_RENDERER, STRING); MAP.put(LOCAL_OBJECT_NOT_ALLOWED, "Named object ''{0}'' is a singleton and cannot be local. Try to use anonymous object instead", NAME); - MAP.put(ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER, "Enum entry ''{0}'' should have a correct delimiter ''{1}'' after it", NAME, STRING); - MAP.put(ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR, "Enum entry ''{0}'' uses deprecated super constructor syntax, use ENTRY(arguments) instead", NAME); - MAP.put(ENUM_ENTRY_AFTER_ENUM_MEMBER, "Enum entry ''{0}'' is not allowed after a member", NAME); MAP.put(ENUM_CLASS_CONSTRUCTOR_CALL, "Enum types cannot be instantiated"); MAP.put(SEALED_CLASS_CONSTRUCTOR_CALL, "Sealed types cannot be instantiated"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index 5885429de1c..cde98d6a8ba 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -849,7 +849,7 @@ public class JetParsing extends AbstractJetParsing { /* * enumClassBody - * : "{" enumEntries ";"? members "}" + * : "{" enumEntries (";" members)? "}" * ; */ private void parseEnumClassBody() { @@ -860,62 +860,59 @@ public class JetParsing extends AbstractJetParsing { advance(); // LBRACE - parseEnumEntries(); - // TODO: syntax without SEMICOLON is deprecated, KT-7605 - consumeIf(SEMICOLON); - parseMembers(true); // Members can include also entries, but it's deprecated syntax - + if (!parseEnumEntries() && !at(RBRACE)) { + error("Expecting ';' after the last enum entry or '}' to close enum class body"); + } + parseMembers(); expect(RBRACE, "Expecting '}' to close enum class body"); + myBuilder.restoreNewlinesState(); body.done(CLASS_BODY); } /** * enumEntries - * : (enumEntry ","? )? + * : enumEntry{","}? * ; + * + * @return true if enum regular members can follow, false otherwise */ - private void parseEnumEntries() { + private boolean parseEnumEntries() { while (!eof() && !at(RBRACE)) { - if (!parseEnumEntry()) { - break; + switch (parseEnumEntry()) { + case FAILED: + // Special case without any enum entries but with possible members after semicolon + if (at(SEMICOLON)) { + advance(); + return true; + } + else { + return false; + } + case NO_DELIMITER: + return false; + case COMMA_DELIMITER: + break; + case SEMICOLON_DELIMITER: + return true; } - parseEnumEntryDelimiter(); } + return false; } - private void parseEnumEntryDelimiter() { - // TODO: syntax with SEMICOLON between enum entries is deprecated, KT-7605 - if (at(SEMICOLON)) { - // Semicolon can be legally here only if member follows - PsiBuilder.Marker temp = mark(); - advance(); // SEMICOLON - ModifierDetector detector = new ModifierDetector(); - parseModifierList(detector, ONLY_ESCAPED_REGULAR_ANNOTATIONS); - if (!atSet(SOFT_KEYWORDS_AT_MEMBER_START) && at(IDENTIFIER)) { - // Otherwise it's old syntax that's not supported - temp.rollbackTo(); - // Despite of the error, try to restore and parse next enum entry - temp = mark(); - advance(); // SEMICOLON - temp.error("Expecting ','"); - } - else { - temp.rollbackTo(); - } - } - else { - // TODO: syntax without COMMA is deprecated (only last entry is an exception), KT-7605 - consumeIf(COMMA); - } + private enum ParseEnumEntryResult { + FAILED, + NO_DELIMITER, + COMMA_DELIMITER, + SEMICOLON_DELIMITER } /* * enumEntry - * : modifiers SimpleName ((":" initializer) | ("(" arguments ")"))? classBody? + * : modifiers SimpleName ("(" arguments ")")? classBody? * ; */ - private boolean parseEnumEntry() { + private ParseEnumEntryResult parseEnumEntry() { PsiBuilder.Marker entry = mark(); ModifierDetector detector = new ModifierDetector(); @@ -946,23 +943,27 @@ public class JetParsing extends AbstractJetParsing { delegatorSuperCall.done(DELEGATOR_SUPER_CALL); initializerList.done(INITIALIZER_LIST); } - // TODO: syntax with COLON is deprecated, should be changed to syntax with LPAR above, KT-7605 - else if (at(COLON)) { - advance(); // COLON - - parseInitializerList(); - } if (at(LBRACE)) { parseClassBody(); } + boolean commaFound = at(COMMA); + if (commaFound) { + advance(); + } + boolean semicolonFound = at(SEMICOLON); + if (semicolonFound) { + advance(); + } // Probably some helper function closeDeclarationWithCommentBinders(entry, ENUM_ENTRY, true); - return true; + return semicolonFound + ? ParseEnumEntryResult.SEMICOLON_DELIMITER + : (commaFound ? ParseEnumEntryResult.COMMA_DELIMITER : ParseEnumEntryResult.NO_DELIMITER); } else { entry.rollbackTo(); - return false; + return ParseEnumEntryResult.FAILED; } } @@ -992,23 +993,8 @@ public class JetParsing extends AbstractJetParsing { * ; */ private void parseMembers() { - parseMembers(false); - } - - private void parseMembers(boolean deprecatedEnumEntryPossible) { - while (!eof()) { - if (at(RBRACE)) { - break; - } - if (deprecatedEnumEntryPossible && parseEnumEntry()) { - // Enum entry is deprecated here - // Error is generated later in DeclarationsChecker - parseEnumEntryDelimiter(); - consumeIf(SEMICOLON); - } - else { - parseMemberDeclaration(); - } + while (!eof() && !at(RBRACE)) { + parseMemberDeclaration(); } } @@ -1162,19 +1148,6 @@ public class JetParsing extends AbstractJetParsing { mark.done(CONSTRUCTOR_DELEGATION_REFERENCE); } - /* - * initializerList - * : initializer - * - */ - private void parseInitializerList() { - // In practice, only one initializer is always in use - PsiBuilder.Marker list = mark(); - if (at(COMMA)) errorAndAdvance("Expecting a this or super constructor call"); - parseInitializer(); - list.done(INITIALIZER_LIST); - } - /* * initializer * : annotations constructorInvocation // type parameters may (must?) be omitted diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetEnumEntry.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetEnumEntry.java index fa0cfaf7171..f2d1da47fd7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetEnumEntry.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetEnumEntry.java @@ -75,6 +75,10 @@ public class JetEnumEntry extends JetClass { return initializerList.getInitializers(); } + public boolean hasInitializer() { + return !getDelegationSpecifiers().isEmpty(); + } + @Nullable public JetInitializerList getInitializerList() { return getStubOrPsiChild(JetStubElementTypes.INITIALIZER_LIST); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java index c015f356694..69e105bd553 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java @@ -502,95 +502,14 @@ public class DeclarationsChecker { } } - // Temporary - // Returns true if deprecated constructor is in use, like - // ENTRY: Enum(arguments) instead of - // ENTRY(arguments) - public static boolean enumEntryUsesDeprecatedSuperConstructor(@NotNull JetEnumEntry enumEntry) { - JetInitializerList initializerList = enumEntry.getInitializerList(); - if (initializerList == null || initializerList.getInitializers().isEmpty()) return false; - JetTypeReference typeReference = initializerList.getInitializers().get(0).getTypeReference(); - if (typeReference == null) return false; - JetUserType userType = (JetUserType) typeReference.getTypeElement(); - if (userType == null || userType.getReferenceExpression() instanceof JetEnumEntrySuperclassReferenceExpression) return false; - return true; - } - - // Temporary - // Returns comma if it's an enum entry without following comma (entry is not last in enum), - // or semicolon if it's an enum entry without following semicolon, may be after comma (entry is last in enum), - // or empty string if an enum entry has the necessary following delimiter - @NotNull - private static String enumEntryExpectedDelimiter(@NotNull JetEnumEntry enumEntry) { - PsiElement next = enumEntry.getNextSibling(); - while (next != null) { - if (next instanceof JetDeclaration) break; - next = next.getNextSibling(); - } - JetDeclaration nextDeclaration = (JetDeclaration) next; - next = PsiUtilPackage.getNextSiblingIgnoringWhitespaceAndComments(enumEntry); - IElementType nextType = next != null ? next.getNode().getElementType() : null; - if (nextDeclaration instanceof JetEnumEntry) { - // Not last - return nextType != JetTokens.COMMA ? "," : ""; - } - else { - // Last: after it we can have semicolon, just closing brace, or comma followed by semicolon / closing brace - if (nextType == JetTokens.COMMA) { - next = PsiUtilPackage.getNextSiblingIgnoringWhitespaceAndComments(next); - nextType = next != null ? next.getNode().getElementType() : null; - } - return nextType != JetTokens.SEMICOLON && nextType != JetTokens.RBRACE ? ";" : ""; - } - } - - public static boolean enumEntryUsesDeprecatedOrNoDelimiter(@NotNull JetEnumEntry enumEntry) { - return !enumEntryExpectedDelimiter(enumEntry).isEmpty(); - } - - static public boolean enumEntryAfterEnumMember(@NotNull JetEnumEntry enumEntry) { - PsiElement previous = enumEntry.getPrevSibling(); - while (previous != null) { - if (previous instanceof JetEnumEntry) return false; - if (previous instanceof JetDeclaration) return true; - previous = previous.getPrevSibling(); - } - return false; - } - private void checkEnumEntry(@NotNull JetEnumEntry enumEntry, @NotNull ClassDescriptor classDescriptor) { - if (enumEntryUsesDeprecatedSuperConstructor(enumEntry)) { - trace.report(Errors.ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR.on(enumEntry, classDescriptor)); - } - String neededDelimiter = enumEntryExpectedDelimiter(enumEntry); - if (!neededDelimiter.isEmpty()) { - trace.report(Errors.ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER.on(enumEntry, classDescriptor, neededDelimiter)); - } - if (enumEntryAfterEnumMember(enumEntry)) { - trace.report(Errors.ENUM_ENTRY_AFTER_ENUM_MEMBER.on(enumEntry, classDescriptor)); - } - DeclarationDescriptor declaration = classDescriptor.getContainingDeclaration(); if (DescriptorUtils.isEnumClass(declaration)) { ClassDescriptor enumClass = (ClassDescriptor) declaration; - List delegationSpecifiers = enumEntry.getDelegationSpecifiers(); ConstructorDescriptor constructor = enumClass.getUnsubstitutedPrimaryConstructor(); - if ((constructor == null || !constructor.getValueParameters().isEmpty()) && delegationSpecifiers.isEmpty()) { - trace.report(ENUM_ENTRY_SHOULD_BE_INITIALIZED.on(enumEntry, enumClass)); - } - - for (JetDelegationSpecifier delegationSpecifier : delegationSpecifiers) { - JetTypeReference typeReference = delegationSpecifier.getTypeReference(); - if (typeReference != null) { - JetType type = trace.getBindingContext().get(TYPE, typeReference); - if (type != null) { - JetType enumType = enumClass.getDefaultType(); - if (!type.getConstructor().equals(enumType.getConstructor())) { - trace.report(ENUM_ENTRY_ILLEGAL_TYPE.on(typeReference, enumClass)); - } - } - } + if ((constructor == null || !constructor.getValueParameters().isEmpty()) && !enumEntry.hasInitializer()) { + trace.report(ENUM_ENTRY_SHOULD_BE_INITIALIZED.on(enumEntry)); } } else { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt1193.kt b/compiler/testData/diagnostics/tests/declarationChecks/kt1193.kt index 69c172272b4..b1f476f251b 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt1193.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt1193.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -//KT-1193 Check enum entry supertype +//KT-1193 Check enum entry supertype / initialization package kt1193 @@ -9,8 +9,5 @@ enum class MyEnum(val i: Int) { } open class A(x: Int = 1) -enum class MyOtherEnum(val i: Int) { - X : A(3), - Y : A(), - Z : A(3) {} -} + +val x: MyEnum = MyEnum.A \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt1193.txt b/compiler/testData/diagnostics/tests/declarationChecks/kt1193.txt index eace815c875..12378f5e4eb 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt1193.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt1193.txt @@ -1,6 +1,7 @@ package package kt1193 { + internal val x: kt1193.MyEnum internal open class A { public constructor A(/*0*/ x: kotlin.Int = ...) @@ -45,40 +46,4 @@ package kt1193 { public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): kt1193.MyEnum public final /*synthesized*/ fun values(): kotlin.Array } - - internal final enum class MyOtherEnum : kotlin.Enum { - public enum entry X : kt1193.A { - private constructor X() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry Y : kt1193.A { - private constructor Y() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry Z : kt1193.A { - private constructor Z() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyOtherEnum(/*0*/ i: kotlin.Int) - internal final val i: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: kt1193.MyOtherEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): kt1193.MyOtherEnum - public final /*synthesized*/ fun values(): kotlin.Array - } } diff --git a/compiler/testData/diagnostics/tests/enum/AbstractInEnum.kt b/compiler/testData/diagnostics/tests/enum/AbstractInEnum.kt index 6d978e817c1..cc563364505 100644 --- a/compiler/testData/diagnostics/tests/enum/AbstractInEnum.kt +++ b/compiler/testData/diagnostics/tests/enum/AbstractInEnum.kt @@ -2,6 +2,7 @@ package abstract enum class MyEnum() { + INSTANCE; //properties val a: Int val a1: Int = 1 diff --git a/compiler/testData/diagnostics/tests/enum/AbstractInEnum.txt b/compiler/testData/diagnostics/tests/enum/AbstractInEnum.txt index 5e7cdfcd98c..39ec1763174 100644 --- a/compiler/testData/diagnostics/tests/enum/AbstractInEnum.txt +++ b/compiler/testData/diagnostics/tests/enum/AbstractInEnum.txt @@ -3,6 +3,45 @@ package package abstract { internal final enum class MyEnum : kotlin.Enum { + public enum entry INSTANCE : abstract.MyEnum { + private constructor INSTANCE() + internal final override /*1*/ /*fake_override*/ val a: kotlin.Int + internal final override /*1*/ /*fake_override*/ val a1: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ val a2: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ val a3: kotlin.Int + internal final override /*1*/ /*fake_override*/ var b: kotlin.Int + internal final override /*1*/ /*fake_override*/ var b1: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ var b2: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ var b3: kotlin.Int + internal final override /*1*/ /*fake_override*/ var c: kotlin.Int + internal final override /*1*/ /*fake_override*/ var c1: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ var c2: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ var c3: kotlin.Int + internal final override /*1*/ /*fake_override*/ val e: kotlin.Int + internal final override /*1*/ /*fake_override*/ val e1: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ val e2: kotlin.Int + internal abstract override /*1*/ /*fake_override*/ val e3: kotlin.Int + internal final override /*1*/ /*fake_override*/ var i: kotlin.Int + internal final override /*1*/ /*fake_override*/ var i1: kotlin.Int + internal final override /*1*/ /*fake_override*/ var j: kotlin.Int + internal final override /*1*/ /*fake_override*/ var j1: kotlin.Int + internal final override /*1*/ /*fake_override*/ var k: kotlin.Int + internal final override /*1*/ /*fake_override*/ var k1: kotlin.Int + internal final override /*1*/ /*fake_override*/ var l: kotlin.Int + internal final override /*1*/ /*fake_override*/ var l1: kotlin.Int + internal final override /*1*/ /*fake_override*/ var n: kotlin.Int + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: abstract.MyEnum): kotlin.Int + public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal final override /*1*/ /*fake_override*/ fun f(): kotlin.Unit + internal final override /*1*/ /*fake_override*/ fun g(): kotlin.Unit + internal abstract override /*1*/ /*fake_override*/ fun h(): kotlin.Unit + public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal abstract override /*1*/ /*fake_override*/ fun j(): kotlin.Unit + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + private constructor MyEnum() internal final val a: kotlin.Int internal final val a1: kotlin.Int = 1 diff --git a/compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.kt b/compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.kt deleted file mode 100644 index 0a311010dfa..00000000000 --- a/compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.kt +++ /dev/null @@ -1,10 +0,0 @@ -// KT-7753: attempt to call enum constructor explicitly -enum class A(val c: Int) { - // No errors at both places, but warnings about deprecated - ONE: A(1), - TWO: A(2); - - fun getA(): A { - return ONE - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.txt b/compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.txt deleted file mode 100644 index b8dc30290fa..00000000000 --- a/compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.txt +++ /dev/null @@ -1,41 +0,0 @@ -package - -internal final enum class A : kotlin.Enum { - public enum entry ONE : A { - private constructor ONE() - internal final override /*1*/ /*fake_override*/ val c: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: A): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun getA(): A - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry TWO : A { - private constructor TWO() - internal final override /*1*/ /*fake_override*/ val c: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: A): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun getA(): A - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor A(/*0*/ c: kotlin.Int) - internal final val c: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: A): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun getA(): A - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): A - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.kt b/compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.kt deleted file mode 100644 index 852526b0d94..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.kt +++ /dev/null @@ -1,6 +0,0 @@ -enum class MyEnum { - A, - B, - - val z = 42 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.txt b/compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.txt deleted file mode 100644 index 79594c7ce1f..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.txt +++ /dev/null @@ -1,38 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry A : MyEnum { - private constructor A() - internal final override /*1*/ /*fake_override*/ val z: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry B : MyEnum { - private constructor B() - internal final override /*1*/ /*fake_override*/ val z: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum() - internal final val z: kotlin.Int = 42 - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumCommaSemicolonBetween.kt b/compiler/testData/diagnostics/tests/enum/enumCommaSemicolonBetween.kt deleted file mode 100644 index 0ba8d8ed041..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumCommaSemicolonBetween.kt +++ /dev/null @@ -1,10 +0,0 @@ -enum class MyEnum { - // Should be comma instead of semicolon - A; - B, - C; - // Semicolon missed, comma is optional - D, - - fun foo() = 0 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumCommaSemicolonBetween.txt b/compiler/testData/diagnostics/tests/enum/enumCommaSemicolonBetween.txt deleted file mode 100644 index 980df59bd12..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumCommaSemicolonBetween.txt +++ /dev/null @@ -1,60 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry A : MyEnum { - private constructor A() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry B : MyEnum { - private constructor B() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry C : MyEnum { - private constructor C() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry D : MyEnum { - private constructor D() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumEntriesAtTheEnd.kt b/compiler/testData/diagnostics/tests/enum/enumEntriesAtTheEnd.kt deleted file mode 100644 index cf217066119..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumEntriesAtTheEnd.kt +++ /dev/null @@ -1,9 +0,0 @@ -enum class MixedEnum { - companion object { - val first = 1 - } - fun foo(): String = "xyz" - ENTRY1 - ENTRY2 - ENTRY3 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumEntriesAtTheEnd.txt b/compiler/testData/diagnostics/tests/enum/enumEntriesAtTheEnd.txt deleted file mode 100644 index 18a20d60eb9..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumEntriesAtTheEnd.txt +++ /dev/null @@ -1,57 +0,0 @@ -package - -internal final enum class MixedEnum : kotlin.Enum { - public enum entry ENTRY1 : MixedEnum { - private constructor ENTRY1() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY2 : MixedEnum { - private constructor ENTRY2() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY3 : MixedEnum { - private constructor ENTRY3() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MixedEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public companion object Companion { - private constructor Companion() - internal final val first: kotlin.Int = 1 - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MixedEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumMissedComma.kt b/compiler/testData/diagnostics/tests/enum/enumMissedComma.kt deleted file mode 100644 index 7131b25d587..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMissedComma.kt +++ /dev/null @@ -1,3 +0,0 @@ -enum class MyEnum { - A, B, C D, E F -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumMissedComma.txt b/compiler/testData/diagnostics/tests/enum/enumMissedComma.txt deleted file mode 100644 index cf6f07283b3..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMissedComma.txt +++ /dev/null @@ -1,75 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry A : MyEnum { - private constructor A() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry B : MyEnum { - private constructor B() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry C : MyEnum { - private constructor C() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry D : MyEnum { - private constructor D() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry E : MyEnum { - private constructor E() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry F : MyEnum { - private constructor F() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumMixed.kt b/compiler/testData/diagnostics/tests/enum/enumMixed.kt deleted file mode 100644 index 2833ebf11aa..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMixed.kt +++ /dev/null @@ -1,9 +0,0 @@ -enum class MixedEnum { - ENTRY1 - companion object { - val first = 1 - } - ENTRY2 - fun foo(): String = "xyz" - ENTRY3 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumMixed.txt b/compiler/testData/diagnostics/tests/enum/enumMixed.txt deleted file mode 100644 index 18a20d60eb9..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMixed.txt +++ /dev/null @@ -1,57 +0,0 @@ -package - -internal final enum class MixedEnum : kotlin.Enum { - public enum entry ENTRY1 : MixedEnum { - private constructor ENTRY1() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY2 : MixedEnum { - private constructor ENTRY2() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY3 : MixedEnum { - private constructor ENTRY3() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MixedEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public companion object Companion { - private constructor Companion() - internal final val first: kotlin.Int = 1 - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MixedEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumMixedWithCommas.kt b/compiler/testData/diagnostics/tests/enum/enumMixedWithCommas.kt deleted file mode 100644 index 8b44dcdb63a..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMixedWithCommas.kt +++ /dev/null @@ -1,9 +0,0 @@ -enum class MixedEnum { - ENTRY1, - companion object { - val first = 1 - } - ENTRY2, - fun foo(): String = "xyz" - ENTRY3 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumMixedWithCommas.txt b/compiler/testData/diagnostics/tests/enum/enumMixedWithCommas.txt deleted file mode 100644 index 18a20d60eb9..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMixedWithCommas.txt +++ /dev/null @@ -1,57 +0,0 @@ -package - -internal final enum class MixedEnum : kotlin.Enum { - public enum entry ENTRY1 : MixedEnum { - private constructor ENTRY1() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY2 : MixedEnum { - private constructor ENTRY2() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY3 : MixedEnum { - private constructor ENTRY3() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MixedEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public companion object Companion { - private constructor Companion() - internal final val first: kotlin.Int = 1 - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MixedEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumMixedWithSemicolons.kt b/compiler/testData/diagnostics/tests/enum/enumMixedWithSemicolons.kt deleted file mode 100644 index cb3b917cfce..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMixedWithSemicolons.kt +++ /dev/null @@ -1,9 +0,0 @@ -enum class MixedEnum { - ENTRY1; - companion object { - val first = 1 - } - ENTRY2; - fun foo(): String = "xyz" - ENTRY3 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumMixedWithSemicolons.txt b/compiler/testData/diagnostics/tests/enum/enumMixedWithSemicolons.txt deleted file mode 100644 index 18a20d60eb9..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMixedWithSemicolons.txt +++ /dev/null @@ -1,57 +0,0 @@ -package - -internal final enum class MixedEnum : kotlin.Enum { - public enum entry ENTRY1 : MixedEnum { - private constructor ENTRY1() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY2 : MixedEnum { - private constructor ENTRY2() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ENTRY3 : MixedEnum { - private constructor ENTRY3() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MixedEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MixedEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun foo(): kotlin.String - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - public companion object Companion { - private constructor Companion() - internal final val first: kotlin.Int = 1 - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MixedEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumNoComma.kt b/compiler/testData/diagnostics/tests/enum/enumNoComma.kt deleted file mode 100644 index b878d606427..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumNoComma.kt +++ /dev/null @@ -1,4 +0,0 @@ -enum class MyEnum { - A - B -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumNoComma.txt b/compiler/testData/diagnostics/tests/enum/enumNoComma.txt deleted file mode 100644 index 990870509c6..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumNoComma.txt +++ /dev/null @@ -1,35 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry A : MyEnum { - private constructor A() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry B : MyEnum { - private constructor B() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumNoSemicolon.kt b/compiler/testData/diagnostics/tests/enum/enumNoSemicolon.kt deleted file mode 100644 index 8e7da05a9a1..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumNoSemicolon.kt +++ /dev/null @@ -1,6 +0,0 @@ -enum class MyEnum { - A, - B - - val z = 42 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumNoSemicolon.txt b/compiler/testData/diagnostics/tests/enum/enumNoSemicolon.txt deleted file mode 100644 index 79594c7ce1f..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumNoSemicolon.txt +++ /dev/null @@ -1,38 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry A : MyEnum { - private constructor A() - internal final override /*1*/ /*fake_override*/ val z: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry B : MyEnum { - private constructor B() - internal final override /*1*/ /*fake_override*/ val z: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum() - internal final val z: kotlin.Int = 42 - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumOldConstructor.kt b/compiler/testData/diagnostics/tests/enum/enumOldConstructor.kt deleted file mode 100644 index 7598574b652..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumOldConstructor.kt +++ /dev/null @@ -1,6 +0,0 @@ -enum class MyEnum(val myArg: Int) { - FIRST(1), - SECOND: MyEnum(2), - THIRD(3), - FOURTH(4) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumOldConstructor.txt b/compiler/testData/diagnostics/tests/enum/enumOldConstructor.txt deleted file mode 100644 index 5b901b7ef1f..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumOldConstructor.txt +++ /dev/null @@ -1,60 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry FIRST : MyEnum { - private constructor FIRST() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry SECOND : MyEnum { - private constructor SECOND() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry THIRD : MyEnum { - private constructor THIRD() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry FOURTH : MyEnum { - private constructor FOURTH() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum(/*0*/ myArg: kotlin.Int) - internal final val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumOldConstructorNamedArgument.kt b/compiler/testData/diagnostics/tests/enum/enumOldConstructorNamedArgument.kt deleted file mode 100644 index 4ada8b51c78..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumOldConstructorNamedArgument.kt +++ /dev/null @@ -1,6 +0,0 @@ -enum class MyEnum(val myArg: Int) { - FIRST(1), - SECOND: MyEnum(myArg = 2), - THIRD(3), - FOURTH(4) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumOldConstructorNamedArgument.txt b/compiler/testData/diagnostics/tests/enum/enumOldConstructorNamedArgument.txt deleted file mode 100644 index 5b901b7ef1f..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumOldConstructorNamedArgument.txt +++ /dev/null @@ -1,60 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry FIRST : MyEnum { - private constructor FIRST() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry SECOND : MyEnum { - private constructor SECOND() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry THIRD : MyEnum { - private constructor THIRD() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry FOURTH : MyEnum { - private constructor FOURTH() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum(/*0*/ myArg: kotlin.Int) - internal final val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumOldConstructors.kt b/compiler/testData/diagnostics/tests/enum/enumOldConstructors.kt deleted file mode 100644 index 288285fb969..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumOldConstructors.kt +++ /dev/null @@ -1,6 +0,0 @@ -enum class MyEnum(val myArg: Int) { - FIRST: MyEnum(1), - SECOND: MyEnum(2), - THIRD: MyEnum(3), - FOURTH: MyEnum(4) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumOldConstructors.txt b/compiler/testData/diagnostics/tests/enum/enumOldConstructors.txt deleted file mode 100644 index 5b901b7ef1f..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumOldConstructors.txt +++ /dev/null @@ -1,60 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry FIRST : MyEnum { - private constructor FIRST() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry SECOND : MyEnum { - private constructor SECOND() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry THIRD : MyEnum { - private constructor THIRD() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry FOURTH : MyEnum { - private constructor FOURTH() - internal final override /*1*/ /*fake_override*/ val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum(/*0*/ myArg: kotlin.Int) - internal final val myArg: kotlin.Int - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/enumSemicolonBetween.kt b/compiler/testData/diagnostics/tests/enum/enumSemicolonBetween.kt deleted file mode 100644 index 02bbdf073e6..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumSemicolonBetween.kt +++ /dev/null @@ -1,8 +0,0 @@ -enum class MyEnum { - A; - B; - C; - D - - fun foo() = 0 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumSemicolonBetween.txt b/compiler/testData/diagnostics/tests/enum/enumSemicolonBetween.txt deleted file mode 100644 index 980df59bd12..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumSemicolonBetween.txt +++ /dev/null @@ -1,60 +0,0 @@ -package - -internal final enum class MyEnum : kotlin.Enum { - public enum entry A : MyEnum { - private constructor A() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry B : MyEnum { - private constructor B() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry C : MyEnum { - private constructor C() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry D : MyEnum { - private constructor D() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - private constructor MyEnum() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun foo(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - - // Static members - public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum - public final /*synthesized*/ fun values(): kotlin.Array -} diff --git a/compiler/testData/diagnostics/tests/enum/interfaceWithEnumKeyword.kt b/compiler/testData/diagnostics/tests/enum/interfaceWithEnumKeyword.kt index b42cf92f216..f5495909499 100644 --- a/compiler/testData/diagnostics/tests/enum/interfaceWithEnumKeyword.kt +++ b/compiler/testData/diagnostics/tests/enum/interfaceWithEnumKeyword.kt @@ -1,6 +1,6 @@ enum interface Some { // Enum part - D + D; // Interface like part fun test() diff --git a/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt b/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt index 210adfc4cdf..4dc5ed2ddd2 100644 --- a/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt +++ b/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt @@ -14,7 +14,7 @@ enum class E { final FINAL, inner INNER, - annotation ANNOTATION, + @annotation ANNOTATION, enum ENUM, out OUT, in IN, diff --git a/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.txt b/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.txt index bb2397fee56..a5090141f8c 100644 --- a/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.txt +++ b/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.txt @@ -102,17 +102,7 @@ internal final enum class E : kotlin.Enum { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - public enum entry annotation : E { - private constructor annotation() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: E): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } - - public enum entry ANNOTATION : E { + kotlin.annotation.annotation() public enum entry ANNOTATION : E { private constructor ANNOTATION() public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: E): kotlin.Int public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.kt b/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.kt index 556b9b8845d..a587186d80a 100644 --- a/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.kt +++ b/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.kt @@ -3,5 +3,5 @@ package bug public enum class Foo { - A : Foo() + A() } diff --git a/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.txt b/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.txt index be8b36bb351..e185142aca5 100644 --- a/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.txt +++ b/compiler/testData/diagnostics/tests/enum/typeParametersInEnum.txt @@ -3,14 +3,8 @@ package package bug { public final enum class Foo : kotlin.Enum> { - public enum entry A : bug.Foo { + public enum entry A { private constructor A() - public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: bug.Foo): kotlin.Int - public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final override /*1*/ /*fake_override*/ fun name(): kotlin.String - public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } private constructor Foo() diff --git a/compiler/testData/diagnostics/tests/regressions/ea69735.kt b/compiler/testData/diagnostics/tests/regressions/ea69735.kt index bfbae2ee31c..c7fd82de1cd 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea69735.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea69735.kt @@ -1,5 +1,5 @@ enum class MyEnum { // Here we have a problem // while checking on a deprecated super constructor - FIRST: -} \ No newline at end of file + FIRST: +} \ No newline at end of file diff --git a/compiler/testData/lineNumber/enum.kt b/compiler/testData/lineNumber/enum.kt index f544c80f4bc..79df835a101 100644 --- a/compiler/testData/lineNumber/enum.kt +++ b/compiler/testData/lineNumber/enum.kt @@ -1,5 +1,5 @@ enum class E { - E1 + E1; fun foo() = { test.lineNumber() diff --git a/compiler/testData/loadJava/compiledKotlin/enum/enumWithConstuctor.kt b/compiler/testData/loadJava/compiledKotlin/enum/enumWithConstuctor.kt index f49dacffaf1..f38aa9f04d4 100644 --- a/compiler/testData/loadJava/compiledKotlin/enum/enumWithConstuctor.kt +++ b/compiler/testData/loadJava/compiledKotlin/enum/enumWithConstuctor.kt @@ -1,7 +1,8 @@ +// ALLOW_AST_ACCESS package test enum class En(val b: Boolean = true, val i: Int = 0) { - E1: En() - E2: En(true, 1) - E3: En(i = 2) + E1(), + E2(true, 1), + E3(i = 2) } diff --git a/compiler/testData/loadJava/compiledKotlin/enum/enumWithInnerClasses.kt b/compiler/testData/loadJava/compiledKotlin/enum/enumWithInnerClasses.kt index baf01776b15..b26abb9b98f 100644 --- a/compiler/testData/loadJava/compiledKotlin/enum/enumWithInnerClasses.kt +++ b/compiler/testData/loadJava/compiledKotlin/enum/enumWithInnerClasses.kt @@ -2,7 +2,7 @@ package test enum class Enum { - ENTRY1 ENTRY2 + ENTRY1, ENTRY2; inner class Inner diff --git a/compiler/testData/loadJava/compiledKotlin/fromLoadJava/enum.kt b/compiler/testData/loadJava/compiledKotlin/fromLoadJava/enum.kt index b36ddafa03b..32cb1a48159 100644 --- a/compiler/testData/loadJava/compiledKotlin/fromLoadJava/enum.kt +++ b/compiler/testData/loadJava/compiledKotlin/fromLoadJava/enum.kt @@ -1,6 +1,7 @@ +// ALLOW_AST_ACCESS package test enum class Test(a : Int) { - A : Test(0) - B : Test(0) {} + A(0), + B(0) {} } diff --git a/compiler/testData/loadJava/compiledKotlin/memberOrder/enumEntries.kt b/compiler/testData/loadJava/compiledKotlin/memberOrder/enumEntries.kt index e92db9f43ed..dc69595e66f 100644 --- a/compiler/testData/loadJava/compiledKotlin/memberOrder/enumEntries.kt +++ b/compiler/testData/loadJava/compiledKotlin/memberOrder/enumEntries.kt @@ -1,12 +1,12 @@ package test enum class E { - ONE - TWO - THREE - FOUR - FIVE - SIX - SEVEN + ONE, + TWO, + THREE, + FOUR, + FIVE, + SIX, + SEVEN, EIGHT } \ No newline at end of file diff --git a/compiler/testData/psi/CommentsBinding.kt b/compiler/testData/psi/CommentsBinding.kt index acfab924bf7..59e3a753e3e 100644 --- a/compiler/testData/psi/CommentsBinding.kt +++ b/compiler/testData/psi/CommentsBinding.kt @@ -57,9 +57,9 @@ public fun foo() { } // end enum class E { - A // this is A - /** This is B */ B - /* And this is C */ C + A, // this is A + /** This is B */ B, + /* And this is C */ C, /** This is X */ X { override fun toString() = "X" diff --git a/compiler/testData/psi/CommentsBinding.txt b/compiler/testData/psi/CommentsBinding.txt index 79582bd0b22..8dea4cf4ce5 100644 --- a/compiler/testData/psi/CommentsBinding.txt +++ b/compiler/testData/psi/CommentsBinding.txt @@ -352,6 +352,7 @@ JetFile: CommentsBinding.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') PsiComment(EOL_COMMENT)('// this is A') PsiWhiteSpace('\n ') @@ -364,12 +365,14 @@ JetFile: CommentsBinding.kt PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('B') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY PsiComment(BLOCK_COMMENT)('/* And this is C */') PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('C') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY KDoc diff --git a/compiler/testData/psi/DefaultKeyword.kt b/compiler/testData/psi/DefaultKeyword.kt index a4417076ad8..8c532877275 100644 --- a/compiler/testData/psi/DefaultKeyword.kt +++ b/compiler/testData/psi/DefaultKeyword.kt @@ -44,7 +44,7 @@ interface A { } enum class D { - A B + A, B; companion object } @@ -68,15 +68,15 @@ val t = companion object { } enum class I { - A - B + A, + B; companion object } enum class I { - A - B + A, + B; companion object {} } \ No newline at end of file diff --git a/compiler/testData/psi/DefaultKeyword.txt b/compiler/testData/psi/DefaultKeyword.txt index bafc2215657..c67863b7ada 100644 --- a/compiler/testData/psi/DefaultKeyword.txt +++ b/compiler/testData/psi/DefaultKeyword.txt @@ -219,10 +219,12 @@ JetFile: DefaultKeyword.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('B') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION MODIFIER_LIST @@ -326,10 +328,12 @@ JetFile: DefaultKeyword.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('B') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION MODIFIER_LIST @@ -353,10 +357,12 @@ JetFile: DefaultKeyword.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('B') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION MODIFIER_LIST diff --git a/compiler/testData/psi/EnumCommas.txt b/compiler/testData/psi/EnumCommas.txt index ee9a6e794f5..2dfea90d695 100644 --- a/compiler/testData/psi/EnumCommas.txt +++ b/compiler/testData/psi/EnumCommas.txt @@ -17,23 +17,23 @@ JetFile: EnumCommas.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('NORTH') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('SOUTH') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('WEST') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('EAST') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - PsiElement(SEMICOLON)(';') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/EnumEntryCommaAnnotatedMember.kt b/compiler/testData/psi/EnumEntryCommaAnnotatedMember.kt new file mode 100644 index 00000000000..491610f7b82 --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaAnnotatedMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST, + + @inline fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaAnnotatedMember.txt b/compiler/testData/psi/EnumEntryCommaAnnotatedMember.txt new file mode 100644 index 00000000000..ffa1694e364 --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaAnnotatedMember.txt @@ -0,0 +1,45 @@ +JetFile: EnumEntryCommaAnnotatedMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiElement(COMMA)(',') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiWhiteSpace('\n\n ') + FUN + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('inline') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaInlineMember.kt b/compiler/testData/psi/EnumEntryCommaInlineMember.kt new file mode 100644 index 00000000000..5c0fb6ad132 --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaInlineMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST, + + inline fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaInlineMember.txt b/compiler/testData/psi/EnumEntryCommaInlineMember.txt new file mode 100644 index 00000000000..a23b81db2b5 --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaInlineMember.txt @@ -0,0 +1,40 @@ +JetFile: EnumEntryCommaInlineMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('inline') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiWhiteSpace(' ') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaMember.kt b/compiler/testData/psi/EnumEntryCommaMember.kt new file mode 100644 index 00000000000..9657b643bac --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST, + + fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaMember.txt b/compiler/testData/psi/EnumEntryCommaMember.txt new file mode 100644 index 00000000000..26f54245c84 --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaMember.txt @@ -0,0 +1,36 @@ +JetFile: EnumEntryCommaMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiElement(COMMA)(',') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiWhiteSpace('\n\n ') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaPublicMember.kt b/compiler/testData/psi/EnumEntryCommaPublicMember.kt new file mode 100644 index 00000000000..8ffbef091f2 --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaPublicMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST, + + public fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryCommaPublicMember.txt b/compiler/testData/psi/EnumEntryCommaPublicMember.txt new file mode 100644 index 00000000000..d38ce592aeb --- /dev/null +++ b/compiler/testData/psi/EnumEntryCommaPublicMember.txt @@ -0,0 +1,39 @@ +JetFile: EnumEntryCommaPublicMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiElement(COMMA)(',') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiWhiteSpace('\n\n ') + FUN + MODIFIER_LIST + PsiElement(public)('public') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySemicolonInlineMember.kt b/compiler/testData/psi/EnumEntrySemicolonInlineMember.kt new file mode 100644 index 00000000000..0191ecececc --- /dev/null +++ b/compiler/testData/psi/EnumEntrySemicolonInlineMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST; + + inline fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySemicolonInlineMember.txt b/compiler/testData/psi/EnumEntrySemicolonInlineMember.txt new file mode 100644 index 00000000000..c7c5b4dd21c --- /dev/null +++ b/compiler/testData/psi/EnumEntrySemicolonInlineMember.txt @@ -0,0 +1,42 @@ +JetFile: EnumEntrySemicolonInlineMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n\n ') + FUN + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('inline') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySemicolonMember.kt b/compiler/testData/psi/EnumEntrySemicolonMember.kt new file mode 100644 index 00000000000..0f5ac9561da --- /dev/null +++ b/compiler/testData/psi/EnumEntrySemicolonMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST; + + fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySemicolonMember.txt b/compiler/testData/psi/EnumEntrySemicolonMember.txt new file mode 100644 index 00000000000..397c03a248a --- /dev/null +++ b/compiler/testData/psi/EnumEntrySemicolonMember.txt @@ -0,0 +1,34 @@ +JetFile: EnumEntrySemicolonMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n\n ') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySpaceInlineMember.kt b/compiler/testData/psi/EnumEntrySpaceInlineMember.kt new file mode 100644 index 00000000000..4b0b3033272 --- /dev/null +++ b/compiler/testData/psi/EnumEntrySpaceInlineMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST + + inline fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySpaceInlineMember.txt b/compiler/testData/psi/EnumEntrySpaceInlineMember.txt new file mode 100644 index 00000000000..fb6e5a22ec6 --- /dev/null +++ b/compiler/testData/psi/EnumEntrySpaceInlineMember.txt @@ -0,0 +1,43 @@ +JetFile: EnumEntrySpaceInlineMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiWhiteSpace('\n\n ') + FUN + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('inline') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySpaceMember.kt b/compiler/testData/psi/EnumEntrySpaceMember.kt new file mode 100644 index 00000000000..edc2fdeded2 --- /dev/null +++ b/compiler/testData/psi/EnumEntrySpaceMember.kt @@ -0,0 +1,5 @@ +enum class My { + FIRST + + fun foo() {} +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntrySpaceMember.txt b/compiler/testData/psi/EnumEntrySpaceMember.txt new file mode 100644 index 00000000000..b76fbd6f5b0 --- /dev/null +++ b/compiler/testData/psi/EnumEntrySpaceMember.txt @@ -0,0 +1,35 @@ +JetFile: EnumEntrySpaceMember.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiWhiteSpace('\n\n ') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryTwoCommas.kt b/compiler/testData/psi/EnumEntryTwoCommas.kt new file mode 100644 index 00000000000..a146ded802c --- /dev/null +++ b/compiler/testData/psi/EnumEntryTwoCommas.kt @@ -0,0 +1,3 @@ +enum class My { + FIRST,, +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumEntryTwoCommas.txt b/compiler/testData/psi/EnumEntryTwoCommas.txt new file mode 100644 index 00000000000..d7bdfd26621 --- /dev/null +++ b/compiler/testData/psi/EnumEntryTwoCommas.txt @@ -0,0 +1,26 @@ +JetFile: EnumEntryTwoCommas.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiElement(COMMA)(',') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumIn.kt b/compiler/testData/psi/EnumIn.kt new file mode 100644 index 00000000000..783e276b600 --- /dev/null +++ b/compiler/testData/psi/EnumIn.kt @@ -0,0 +1,3 @@ +enum class Foo { + `in` +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumIn.txt b/compiler/testData/psi/EnumIn.txt new file mode 100644 index 00000000000..d55855a9547 --- /dev/null +++ b/compiler/testData/psi/EnumIn.txt @@ -0,0 +1,21 @@ +JetFile: EnumIn.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Foo') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('`in`') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumMissingName.txt b/compiler/testData/psi/EnumMissingName.txt index f3869c692fe..1f86dee5abe 100644 --- a/compiler/testData/psi/EnumMissingName.txt +++ b/compiler/testData/psi/EnumMissingName.txt @@ -47,7 +47,7 @@ JetFile: EnumMissingName.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0xFF000') PsiElement(RPAR)(')') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME @@ -65,7 +65,7 @@ JetFile: EnumMissingName.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0x00FF00') PsiElement(RPAR)(')') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME diff --git a/compiler/testData/psi/EnumNoAnnotations.kt b/compiler/testData/psi/EnumNoAnnotations.kt deleted file mode 100644 index ddd63420397..00000000000 --- a/compiler/testData/psi/EnumNoAnnotations.kt +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index e91cfad7521..00000000000 --- a/compiler/testData/psi/EnumNoAnnotations.txt +++ /dev/null @@ -1,102 +0,0 @@ -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') - IMPORT_LIST - - 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)('}') diff --git a/compiler/testData/psi/EnumOldConstructorSyntax.kt b/compiler/testData/psi/EnumOldConstructorSyntax.kt new file mode 100644 index 00000000000..a79ade99056 --- /dev/null +++ b/compiler/testData/psi/EnumOldConstructorSyntax.kt @@ -0,0 +1,5 @@ +enum class My(x: Int) { + FIRST: My(13) + + val y = x + 1 +} \ No newline at end of file diff --git a/compiler/testData/psi/EnumOldConstructorSyntax.txt b/compiler/testData/psi/EnumOldConstructorSyntax.txt new file mode 100644 index 00000000000..d63567a571f --- /dev/null +++ b/compiler/testData/psi/EnumOldConstructorSyntax.txt @@ -0,0 +1,68 @@ +JetFile: EnumOldConstructorSyntax.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('My') + PRIMARY_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(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('FIRST') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiErrorElement:Expecting member declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('My') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('13') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('y') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/EnumSemicolonBetween.kt b/compiler/testData/psi/EnumSemicolonBetween.kt deleted file mode 100644 index 5ce341826c7..00000000000 --- a/compiler/testData/psi/EnumSemicolonBetween.kt +++ /dev/null @@ -1,6 +0,0 @@ -enum class Color { - NORTH; - SOUTH; - WEST; - EAST -} \ No newline at end of file diff --git a/compiler/testData/psi/EnumSemicolonBetween.txt b/compiler/testData/psi/EnumSemicolonBetween.txt deleted file mode 100644 index b2abdb58354..00000000000 --- a/compiler/testData/psi/EnumSemicolonBetween.txt +++ /dev/null @@ -1,39 +0,0 @@ -JetFile: EnumSemicolonBetween.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Color') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('NORTH') - PsiErrorElement:Expecting ',' - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('SOUTH') - PsiErrorElement:Expecting ',' - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('WEST') - PsiErrorElement:Expecting ',' - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('EAST') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/EnumSemicolonBetweenWithMembers.kt b/compiler/testData/psi/EnumSemicolonBetweenWithMembers.kt deleted file mode 100644 index 8c1bea46333..00000000000 --- a/compiler/testData/psi/EnumSemicolonBetweenWithMembers.kt +++ /dev/null @@ -1,10 +0,0 @@ -enum class Color { - NORTH; - fun foo() = 1 - SOUTH; - companion object { - fun bar() = 2 - } - WEST; - EAST -} \ No newline at end of file diff --git a/compiler/testData/psi/EnumSemicolonBetweenWithMembers.txt b/compiler/testData/psi/EnumSemicolonBetweenWithMembers.txt deleted file mode 100644 index a5be266ba5a..00000000000 --- a/compiler/testData/psi/EnumSemicolonBetweenWithMembers.txt +++ /dev/null @@ -1,74 +0,0 @@ -JetFile: EnumSemicolonBetweenWithMembers.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Color') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('NORTH') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - FUN - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('SOUTH') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - OBJECT_DECLARATION - MODIFIER_LIST - PsiElement(companion)('companion') - PsiWhiteSpace(' ') - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - FUN - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('bar') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('2') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('WEST') - PsiErrorElement:Expecting ',' - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('EAST') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/EnumShortCommas.txt b/compiler/testData/psi/EnumShortCommas.txt index 5973a9e43be..12e96835f97 100644 --- a/compiler/testData/psi/EnumShortCommas.txt +++ b/compiler/testData/psi/EnumShortCommas.txt @@ -45,7 +45,7 @@ JetFile: EnumShortCommas.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0xFF000') PsiElement(RPAR)(')') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME @@ -63,7 +63,7 @@ JetFile: EnumShortCommas.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0x00FF00') PsiElement(RPAR)(')') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME @@ -81,8 +81,8 @@ JetFile: EnumShortCommas.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0x0000FF') PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - PsiElement(SEMICOLON)(';') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/EnumShortNoCommas.kt b/compiler/testData/psi/EnumShortNoCommas.kt deleted file mode 100644 index 43ee645d9fc..00000000000 --- a/compiler/testData/psi/EnumShortNoCommas.kt +++ /dev/null @@ -1,7 +0,0 @@ -// NB: this test uses deprecated syntax -// Delete it when this syntax is no longer supported -enum class Color(val rgb : Int) { - RED(0xFF000) - GREEN(0x00FF00) - BLUE(0x0000FF) -} \ No newline at end of file diff --git a/compiler/testData/psi/EnumShortNoCommas.txt b/compiler/testData/psi/EnumShortNoCommas.txt deleted file mode 100644 index 15642145094..00000000000 --- a/compiler/testData/psi/EnumShortNoCommas.txt +++ /dev/null @@ -1,87 +0,0 @@ -JetFile: EnumShortNoCommas.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - CLASS - PsiComment(EOL_COMMENT)('// NB: this test uses deprecated syntax') - PsiWhiteSpace('\n') - PsiComment(EOL_COMMENT)('// Delete it when this syntax is no longer supported') - PsiWhiteSpace('\n') - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Color') - PRIMARY_CONSTRUCTOR - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('rgb') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('RED') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION - - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0xFF000') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GREEN') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION - - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0x00FF00') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('BLUE') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION - - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0x0000FF') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/EnumShortWithOverload.txt b/compiler/testData/psi/EnumShortWithOverload.txt index 223dc280627..40a4ee8b285 100644 --- a/compiler/testData/psi/EnumShortWithOverload.txt +++ b/compiler/testData/psi/EnumShortWithOverload.txt @@ -78,7 +78,7 @@ JetFile: EnumShortWithOverload.kt PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME @@ -129,7 +129,7 @@ JetFile: EnumShortWithOverload.kt PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME @@ -180,7 +180,7 @@ JetFile: EnumShortWithOverload.kt PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') - PsiElement(SEMICOLON)(';') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n \n ') FUN MODIFIER_LIST diff --git a/compiler/testData/psi/EnumShortWithOverloadNoCommas.kt b/compiler/testData/psi/EnumShortWithOverloadNoCommas.kt deleted file mode 100644 index 73772645593..00000000000 --- a/compiler/testData/psi/EnumShortWithOverloadNoCommas.kt +++ /dev/null @@ -1,13 +0,0 @@ -enum class Color(val rgb : Int) { - RED(0xFF000) { - override fun foo(): Int { return 1 } - } - GREEN(0x00FF00) { - override fun foo(): Int { return 2 } - } - BLUE(0x0000FF) { - override fun foo(): Int { return 3 } - } - - abstract fun foo(): Int -} \ No newline at end of file diff --git a/compiler/testData/psi/EnumShortWithOverloadNoCommas.txt b/compiler/testData/psi/EnumShortWithOverloadNoCommas.txt deleted file mode 100644 index 027e33c3766..00000000000 --- a/compiler/testData/psi/EnumShortWithOverloadNoCommas.txt +++ /dev/null @@ -1,199 +0,0 @@ -JetFile: EnumShortWithOverloadNoCommas.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Color') - PRIMARY_CONSTRUCTOR - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('rgb') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('RED') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION - - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0xFF000') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - FUN - MODIFIER_LIST - PsiElement(override)('override') - PsiWhiteSpace(' ') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') - PsiWhiteSpace(' ') - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiWhiteSpace(' ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('GREEN') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION - - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0x00FF00') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - FUN - MODIFIER_LIST - PsiElement(override)('override') - PsiWhiteSpace(' ') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') - PsiWhiteSpace(' ') - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('2') - PsiWhiteSpace(' ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('BLUE') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION - - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0x0000FF') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - FUN - MODIFIER_LIST - PsiElement(override)('override') - PsiWhiteSpace(' ') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') - PsiWhiteSpace(' ') - RETURN - PsiElement(return)('return') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('3') - PsiWhiteSpace(' ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n \n ') - FUN - MODIFIER_LIST - PsiElement(abstract)('abstract') - PsiWhiteSpace(' ') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/Enums.kt b/compiler/testData/psi/Enums.kt index f9064c7cb49..dda485c8186 100644 --- a/compiler/testData/psi/Enums.kt +++ b/compiler/testData/psi/Enums.kt @@ -1,5 +1,7 @@ enum class Color(val rgb : Int) { - RED : Color(0xFF000) - GREEN : Color(0x00FF00) - BLUE : Color(0x0000FF) + RED(0xFF000), + GREEN(0x00FF00), + BLUE(0x0000FF) + + // the end } \ No newline at end of file diff --git a/compiler/testData/psi/Enums.txt b/compiler/testData/psi/Enums.txt index 90fb4977729..eef959a71aa 100644 --- a/compiler/testData/psi/Enums.txt +++ b/compiler/testData/psi/Enums.txt @@ -32,61 +32,56 @@ JetFile: Enums.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('RED') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Color') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0xFF000') PsiElement(RPAR)(')') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('GREEN') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Color') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0x00FF00') PsiElement(RPAR)(')') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('BLUE') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Color') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0x0000FF') PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n ') + PsiComment(EOL_COMMENT)('// the end') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/SimpleModifiers.kt b/compiler/testData/psi/SimpleModifiers.kt index ac9d1dbc7b9..fecd6d63580 100644 --- a/compiler/testData/psi/SimpleModifiers.kt +++ b/compiler/testData/psi/SimpleModifiers.kt @@ -2,7 +2,6 @@ package foo.bar.goo abstract open -enum open annotation override diff --git a/compiler/testData/psi/SimpleModifiers.txt b/compiler/testData/psi/SimpleModifiers.txt index 4f12a5390f4..edd4da37d6c 100644 --- a/compiler/testData/psi/SimpleModifiers.txt +++ b/compiler/testData/psi/SimpleModifiers.txt @@ -21,8 +21,6 @@ JetFile: SimpleModifiers.kt PsiWhiteSpace('\n') PsiElement(open)('open') PsiWhiteSpace('\n') - PsiElement(enum)('enum') - PsiWhiteSpace('\n') PsiElement(open)('open') PsiWhiteSpace('\n') ANNOTATION_ENTRY diff --git a/compiler/testData/psi/SoftKeywords.kt b/compiler/testData/psi/SoftKeywords.kt index b2ebd5d865e..29d9fb357be 100644 --- a/compiler/testData/psi/SoftKeywords.kt +++ b/compiler/testData/psi/SoftKeywords.kt @@ -5,7 +5,6 @@ import foo public protected private internal abstract open -enum open annotation override diff --git a/compiler/testData/psi/SoftKeywords.txt b/compiler/testData/psi/SoftKeywords.txt index b99c8b8983e..6f8cdcef66b 100644 --- a/compiler/testData/psi/SoftKeywords.txt +++ b/compiler/testData/psi/SoftKeywords.txt @@ -34,8 +34,6 @@ JetFile: SoftKeywords.kt PsiWhiteSpace('\n') PsiElement(open)('open') PsiWhiteSpace('\n') - PsiElement(enum)('enum') - PsiWhiteSpace('\n') PsiElement(open)('open') PsiWhiteSpace('\n') ANNOTATION_ENTRY diff --git a/compiler/testData/psi/annotation/at/enumEntries.kt b/compiler/testData/psi/annotation/at/enumEntries.kt index 1c294667f6b..942933b9a7b 100644 --- a/compiler/testData/psi/annotation/at/enumEntries.kt +++ b/compiler/testData/psi/annotation/at/enumEntries.kt @@ -1,13 +1,14 @@ enum class A { - @[Ann] @Ann(1) X : A() + @[Ann] @Ann(1) X(), - @Ann Y : A() {} + @Ann Y() {}, - private @Ann() Z : A() + private @Ann() Z(), - @Ann @private Q + @Ann @private Q, - Ann() W + // TODO: try to make Ann() working here (?) + @Ann() W; @Ann fun foo() {} } diff --git a/compiler/testData/psi/annotation/at/enumEntries.txt b/compiler/testData/psi/annotation/at/enumEntries.txt index 8d23e4fde86..dd848e5baef 100644 --- a/compiler/testData/psi/annotation/at/enumEntries.txt +++ b/compiler/testData/psi/annotation/at/enumEntries.txt @@ -43,19 +43,17 @@ JetFile: enumEntries.kt PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('X') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') + PsiElement(COMMA)(',') PsiWhiteSpace('\n\n ') ENUM_ENTRY MODIFIER_LIST @@ -69,16 +67,13 @@ JetFile: enumEntries.kt PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Y') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') @@ -86,6 +81,7 @@ JetFile: enumEntries.kt CLASS_BODY PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') + PsiElement(COMMA)(',') PsiWhiteSpace('\n\n ') ENUM_ENTRY MODIFIER_LIST @@ -104,19 +100,17 @@ JetFile: enumEntries.kt PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Z') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') + PsiElement(COMMA)(',') PsiWhiteSpace('\n\n ') ENUM_ENTRY MODIFIER_LIST @@ -132,24 +126,26 @@ JetFile: enumEntries.kt PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Q') + PsiElement(COMMA)(',') PsiWhiteSpace('\n\n ') ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Ann') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL + PsiComment(EOL_COMMENT)('// TODO: try to make Ann() working here (?)') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION - + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Ann') VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - ENUM_ENTRY + PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('W') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') FUN MODIFIER_LIST diff --git a/compiler/testData/psi/annotation/options/annotation.txt b/compiler/testData/psi/annotation/options/annotation.txt index f1df48cc47f..b9815410cf1 100644 --- a/compiler/testData/psi/annotation/options/annotation.txt +++ b/compiler/testData/psi/annotation/options/annotation.txt @@ -19,7 +19,7 @@ JetFile: annotation.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('CLASSIFIER') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME @@ -41,12 +41,12 @@ JetFile: annotation.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('SOURCE') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('BINARY') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME diff --git a/compiler/testData/psi/examples/AnonymousObjects.kt b/compiler/testData/psi/examples/AnonymousObjects.kt index b9706fdcfab..c4bbceb7fe9 100644 --- a/compiler/testData/psi/examples/AnonymousObjects.kt +++ b/compiler/testData/psi/examples/AnonymousObjects.kt @@ -11,7 +11,7 @@ addMouseListener(object : MouseAdapter() { }) enum class GodMessages { - TOO_MANY_CLICKS + TOO_MANY_CLICKS, ONE_MORE_MESSAGE } diff --git a/compiler/testData/psi/examples/AnonymousObjects.txt b/compiler/testData/psi/examples/AnonymousObjects.txt index b0118d15501..100b8c39967 100644 --- a/compiler/testData/psi/examples/AnonymousObjects.txt +++ b/compiler/testData/psi/examples/AnonymousObjects.txt @@ -139,6 +139,7 @@ JetFile: AnonymousObjects.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('TOO_MANY_CLICKS') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME diff --git a/compiler/testData/psi/examples/Color.kt b/compiler/testData/psi/examples/Color.kt index 7b36277efee..64b8445205d 100644 --- a/compiler/testData/psi/examples/Color.kt +++ b/compiler/testData/psi/examples/Color.kt @@ -1,5 +1,5 @@ enum class Color(val r : Int, val g : Int, val sb : Int) { - RED : Color(255, 0, 0) - GREEN : Color(0, 255, 0) - BLUE : Color(0, 0, 255) + RED(255, 0, 0), + GREEN(0, 255, 0), + BLUE(0, 0, 255) } \ No newline at end of file diff --git a/compiler/testData/psi/examples/Color.txt b/compiler/testData/psi/examples/Color.txt index 3d18fbaae71..606c94897e5 100644 --- a/compiler/testData/psi/examples/Color.txt +++ b/compiler/testData/psi/examples/Color.txt @@ -58,16 +58,13 @@ JetFile: Color.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('RED') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Color') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT @@ -84,20 +81,18 @@ JetFile: Color.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0') PsiElement(RPAR)(')') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('GREEN') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Color') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT @@ -114,20 +109,18 @@ JetFile: Color.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('0') PsiElement(RPAR)(')') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('BLUE') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Color') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT diff --git a/compiler/testData/psi/examples/util/Comparison.txt b/compiler/testData/psi/examples/util/Comparison.txt index 01f8621cfbc..dadf55c160c 100644 --- a/compiler/testData/psi/examples/util/Comparison.txt +++ b/compiler/testData/psi/examples/util/Comparison.txt @@ -219,17 +219,17 @@ JetFile: Comparison.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('LS') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('EQ') - PsiElement(COMMA)(',') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('GR') - PsiElement(SEMICOLON)(';') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/namelessObjectAsEnumMember.kt b/compiler/testData/psi/namelessObjectAsEnumMember.kt index d7dab7ddf26..25e8a893410 100644 --- a/compiler/testData/psi/namelessObjectAsEnumMember.kt +++ b/compiler/testData/psi/namelessObjectAsEnumMember.kt @@ -1,7 +1,7 @@ // test that inner keyword is not parsed as enum entry public enum class A { - A - B + A, + B; inner object } diff --git a/compiler/testData/psi/namelessObjectAsEnumMember.txt b/compiler/testData/psi/namelessObjectAsEnumMember.txt index 55d87cf2f2e..eeb7dfed716 100644 --- a/compiler/testData/psi/namelessObjectAsEnumMember.txt +++ b/compiler/testData/psi/namelessObjectAsEnumMember.txt @@ -21,10 +21,12 @@ JetFile: namelessObjectAsEnumMember.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('B') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION MODIFIER_LIST diff --git a/compiler/testData/psi/recovery/EnumEntryInitList.kt b/compiler/testData/psi/recovery/EnumEntryInitList.kt deleted file mode 100644 index 40ceef12b83..00000000000 --- a/compiler/testData/psi/recovery/EnumEntryInitList.kt +++ /dev/null @@ -1,45 +0,0 @@ -enum class E1 { - FIRST: -} - -enum class E2 { - FIRST: - - fun some() {} -} - -enum class E3 { - FIRST: - - val some = 1 -} - -enum class E4 { - FIRST: - - class Other -} - -enum class E5 { - FIRST: E5(), - - class Other -} - -enum class E6 { - FIRST: E6(),; - - class Other -} - -enum class E7 { - FIRST: - - @[Some] - SECOND -} - -enum class E8 { - FIRST: - SECOND -} \ No newline at end of file diff --git a/compiler/testData/psi/recovery/EnumEntryInitList.txt b/compiler/testData/psi/recovery/EnumEntryInitList.txt deleted file mode 100644 index 2ec047794a6..00000000000 --- a/compiler/testData/psi/recovery/EnumEntryInitList.txt +++ /dev/null @@ -1,255 +0,0 @@ -JetFile: EnumEntryInitList.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E1') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace('\n') - INITIALIZER_LIST - PsiErrorElement:Expecting constructor call ((...)) - - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E2') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace('\n\n ') - INITIALIZER_LIST - PsiErrorElement:Expecting constructor call ((...)) - - FUN - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('some') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E3') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace('\n\n ') - INITIALIZER_LIST - PsiErrorElement:Expecting constructor call ((...)) - - PROPERTY - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('some') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E4') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace('\n\n ') - INITIALIZER_LIST - PsiErrorElement:Expecting constructor call ((...)) - - CLASS - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Other') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E5') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E5') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n\n ') - CLASS - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Other') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E6') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E6') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n\n ') - CLASS - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('Other') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E7') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace('\n\n ') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - ANNOTATION - PsiElement(AT)('@') - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Some') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n ') - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('SECOND') - PsiWhiteSpace('\n') - VALUE_ARGUMENT_LIST - PsiErrorElement:Expecting an argument list - - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(enum)('enum') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('E8') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - ENUM_ENTRY - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('FIRST') - PsiElement(COLON)(':') - PsiWhiteSpace('\n ') - INITIALIZER_LIST - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('SECOND') - PsiWhiteSpace('\n') - VALUE_ARGUMENT_LIST - PsiErrorElement:Expecting an argument list - - PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/secondaryConstructors/enumParsing.kt b/compiler/testData/psi/secondaryConstructors/enumParsing.kt index e99add9657c..200a353d8f6 100644 --- a/compiler/testData/psi/secondaryConstructors/enumParsing.kt +++ b/compiler/testData/psi/secondaryConstructors/enumParsing.kt @@ -1,7 +1,7 @@ enum class A { - abc1 : A(1,2,3) - abc2 : A(1,2,3) {} - abc3 + abc1(1,2,3), + abc2(1,2,3) {}, + abc3; constructor(x: Int) {} diff --git a/compiler/testData/psi/secondaryConstructors/enumParsing.txt b/compiler/testData/psi/secondaryConstructors/enumParsing.txt index ebd3f8bc1e9..13ea8226414 100644 --- a/compiler/testData/psi/secondaryConstructors/enumParsing.txt +++ b/compiler/testData/psi/secondaryConstructors/enumParsing.txt @@ -17,16 +17,13 @@ JetFile: enumParsing.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('abc1') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT @@ -41,20 +38,18 @@ JetFile: enumParsing.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('3') PsiElement(RPAR)(')') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('abc2') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') INITIALIZER_LIST DELEGATOR_SUPER_CALL CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT @@ -73,10 +68,12 @@ JetFile: enumParsing.kt CLASS_BODY PsiElement(LBRACE)('{') PsiElement(RBRACE)('}') + PsiElement(COMMA)(',') PsiWhiteSpace('\n ') ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('abc3') + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n ') SECONDARY_CONSTRUCTOR PsiElement(constructor)('constructor') diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index eda4793cbe1..fa2386346d4 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -5136,24 +5136,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } - @TestMetadata("enumCommaNoSemicolon.kt") - public void testEnumCommaNoSemicolon() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.kt"); - doTest(fileName); - } - - @TestMetadata("enumCommaSemicolonBetween.kt") - public void testEnumCommaSemicolonBetween() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumCommaSemicolonBetween.kt"); - doTest(fileName); - } - - @TestMetadata("enumEntriesAtTheEnd.kt") - public void testEnumEntriesAtTheEnd() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumEntriesAtTheEnd.kt"); - doTest(fileName); - } - @TestMetadata("enumEntryCannotHaveClassObject.kt") public void testEnumEntryCannotHaveClassObject() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumEntryCannotHaveClassObject.kt"); @@ -5184,78 +5166,18 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } - @TestMetadata("enumMissedComma.kt") - public void testEnumMissedComma() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumMissedComma.kt"); - doTest(fileName); - } - @TestMetadata("enumMissingName.kt") public void testEnumMissingName() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumMissingName.kt"); doTest(fileName); } - @TestMetadata("enumMixed.kt") - public void testEnumMixed() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumMixed.kt"); - doTest(fileName); - } - - @TestMetadata("enumMixedWithCommas.kt") - public void testEnumMixedWithCommas() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumMixedWithCommas.kt"); - doTest(fileName); - } - - @TestMetadata("enumMixedWithSemicolons.kt") - public void testEnumMixedWithSemicolons() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumMixedWithSemicolons.kt"); - doTest(fileName); - } - @TestMetadata("enumModifier.kt") public void testEnumModifier() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumModifier.kt"); doTest(fileName); } - @TestMetadata("enumNoComma.kt") - public void testEnumNoComma() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumNoComma.kt"); - doTest(fileName); - } - - @TestMetadata("enumNoSemicolon.kt") - public void testEnumNoSemicolon() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumNoSemicolon.kt"); - doTest(fileName); - } - - @TestMetadata("enumOldConstructor.kt") - public void testEnumOldConstructor() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumOldConstructor.kt"); - doTest(fileName); - } - - @TestMetadata("enumOldConstructorNamedArgument.kt") - public void testEnumOldConstructorNamedArgument() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumOldConstructorNamedArgument.kt"); - doTest(fileName); - } - - @TestMetadata("enumOldConstructors.kt") - public void testEnumOldConstructors() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumOldConstructors.kt"); - doTest(fileName); - } - - @TestMetadata("enumSemicolonBetween.kt") - public void testEnumSemicolonBetween() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumSemicolonBetween.kt"); - doTest(fileName); - } - @TestMetadata("enumStarImport.kt") public void testEnumStarImport() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumStarImport.kt"); @@ -5388,12 +5310,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } - @TestMetadata("OldSyntaxConstructorCall.kt") - public void testOldSyntaxConstructorCall() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/OldSyntaxConstructorCall.kt"); - doTest(fileName); - } - @TestMetadata("openMemberInEnum.kt") public void testOpenMemberInEnum() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/openMemberInEnum.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ClassGenTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/ClassGenTest.java index da8a57f0b16..a527aea74ca 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ClassGenTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ClassGenTest.java @@ -120,7 +120,7 @@ public class ClassGenTest extends CodegenTestCase { } public void testEnumConstantConstructors() throws Exception { - loadText("enum class Color(val rgb: Int) { RED: Color(0xFF0000), GREEN: Color(0x00FF00); }"); + loadText("enum class Color(val rgb: Int) { RED(0xFF0000), GREEN(0x00FF00); }"); Class colorClass = generateClass("Color"); Field redField = colorClass.getField("RED"); Object redValue = redField.get(null); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestFiles.java b/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestFiles.java index 36f05fcb458..7aefb9e4e6d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestFiles.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CodegenTestFiles.java @@ -105,7 +105,7 @@ public class CodegenTestFiles { String content = CheckerTestUtil.parseDiagnosedRanges(contentWithDiagnosticMarkup, new ArrayList()); JetFile file = JetTestUtils.createFile(fileName, content, project); List ranges = AnalyzingUtils.getSyntaxErrorRanges(file); - assert ranges.isEmpty() : "Syntax errors found: " + ranges; + assert ranges.isEmpty() : "Syntax errors found in " + file + ": " + ranges; List> expectedValues = Lists.newArrayList(); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/EnumGenTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/EnumGenTest.java index 96857d3cbf5..824bb200259 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/EnumGenTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/EnumGenTest.java @@ -56,7 +56,7 @@ public class EnumGenTest extends CodegenTestCase { } public void testEnumConstantConstructors() throws Exception { - loadText("enum class Color(val rgb: Int) { RED: Color(0xFF0000), GREEN: Color(0x00FF00); }"); + loadText("enum class Color(val rgb: Int) { RED(0xFF0000), GREEN(0x00FF00); }"); Class colorClass = generateClass("Color"); Field redField = colorClass.getField("RED"); Object redValue = redField.get(null); diff --git a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java index defaa843337..0f348603fe2 100644 --- a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java @@ -211,27 +211,75 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } + @TestMetadata("EnumEntryCommaAnnotatedMember.kt") + public void testEnumEntryCommaAnnotatedMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntryCommaAnnotatedMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntryCommaInlineMember.kt") + public void testEnumEntryCommaInlineMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntryCommaInlineMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntryCommaMember.kt") + public void testEnumEntryCommaMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntryCommaMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntryCommaPublicMember.kt") + public void testEnumEntryCommaPublicMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntryCommaPublicMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntrySemicolonInlineMember.kt") + public void testEnumEntrySemicolonInlineMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntrySemicolonInlineMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntrySemicolonMember.kt") + public void testEnumEntrySemicolonMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntrySemicolonMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntrySpaceInlineMember.kt") + public void testEnumEntrySpaceInlineMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntrySpaceInlineMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntrySpaceMember.kt") + public void testEnumEntrySpaceMember() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntrySpaceMember.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumEntryTwoCommas.kt") + public void testEnumEntryTwoCommas() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumEntryTwoCommas.kt"); + doParsingTest(fileName); + } + + @TestMetadata("EnumIn.kt") + public void testEnumIn() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumIn.kt"); + doParsingTest(fileName); + } + @TestMetadata("EnumMissingName.kt") public void testEnumMissingName() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumMissingName.kt"); doParsingTest(fileName); } - @TestMetadata("EnumNoAnnotations.kt") - public void testEnumNoAnnotations() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumNoAnnotations.kt"); - doParsingTest(fileName); - } - - @TestMetadata("EnumSemicolonBetween.kt") - public void testEnumSemicolonBetween() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumSemicolonBetween.kt"); - doParsingTest(fileName); - } - - @TestMetadata("EnumSemicolonBetweenWithMembers.kt") - public void testEnumSemicolonBetweenWithMembers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumSemicolonBetweenWithMembers.kt"); + @TestMetadata("EnumOldConstructorSyntax.kt") + public void testEnumOldConstructorSyntax() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumOldConstructorSyntax.kt"); doParsingTest(fileName); } @@ -241,24 +289,12 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } - @TestMetadata("EnumShortNoCommas.kt") - public void testEnumShortNoCommas() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumShortNoCommas.kt"); - doParsingTest(fileName); - } - @TestMetadata("EnumShortWithOverload.kt") public void testEnumShortWithOverload() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumShortWithOverload.kt"); doParsingTest(fileName); } - @TestMetadata("EnumShortWithOverloadNoCommas.kt") - public void testEnumShortWithOverloadNoCommas() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumShortWithOverloadNoCommas.kt"); - doParsingTest(fileName); - } - @TestMetadata("EnumWithAnnotationKeyword.kt") public void testEnumWithAnnotationKeyword() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/EnumWithAnnotationKeyword.kt"); @@ -1797,12 +1833,6 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } - @TestMetadata("EnumEntryInitList.kt") - public void testEnumEntryInitList() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/recovery/EnumEntryInitList.kt"); - doParsingTest(fileName); - } - @TestMetadata("ForEmptyParentheses.kt") public void testForEmptyParentheses() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/recovery/ForEmptyParentheses.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java b/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java index e1b1630c412..47caef01df1 100644 --- a/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java +++ b/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java @@ -240,11 +240,11 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testFunctionModalityInClass("abstract class A { open fun foo() }", Modality.OPEN); tc.testFunctionModalityInClass("abstract class A { abstract fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInEnum("enum class A { fun foo() {} }", Modality.FINAL); - tc.testFunctionModalityInEnum("enum class A { final fun foo() {} }", Modality.FINAL); - tc.testFunctionModalityInEnum("open enum class A { open fun foo() {} }", Modality.OPEN); - tc.testFunctionModalityInEnum("abstract enum class A { open fun foo() }", Modality.OPEN); - tc.testFunctionModalityInEnum("abstract enum class A { abstract fun foo() }", Modality.ABSTRACT); + tc.testFunctionModalityInEnum("enum class A { ; fun foo() {} }", Modality.FINAL); + tc.testFunctionModalityInEnum("enum class A { ; final fun foo() {} }", Modality.FINAL); + tc.testFunctionModalityInEnum("open enum class A { ; open fun foo() {} }", Modality.OPEN); + tc.testFunctionModalityInEnum("abstract enum class A { ; open fun foo() }", Modality.OPEN); + tc.testFunctionModalityInEnum("abstract enum class A { ; abstract fun foo() }", Modality.ABSTRACT); tc.testFunctionModalityInTrait("trait A { fun foo() }", Modality.ABSTRACT); tc.testFunctionModalityInTrait("trait A { abstract fun foo() }", Modality.ABSTRACT); @@ -264,11 +264,11 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testFunctionModalityInClass("abstract class A : C { open override fun foo() }", Modality.OPEN); tc.testFunctionModalityInClass("abstract class A : C { abstract override fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInEnum("enum class A : C { override fun foo() {} }", Modality.OPEN); - tc.testFunctionModalityInEnum("enum class A : C { final override fun foo() {} }", Modality.FINAL); - tc.testFunctionModalityInEnum("open enum class A : C { open override fun foo() {} }", Modality.OPEN); - tc.testFunctionModalityInEnum("abstract enum class A : C { open override fun foo() }", Modality.OPEN); - tc.testFunctionModalityInEnum("abstract enum class A : C { abstract override fun foo() }", Modality.ABSTRACT); + tc.testFunctionModalityInEnum("enum class A : C { ; override fun foo() {} }", Modality.OPEN); + tc.testFunctionModalityInEnum("enum class A : C { ; final override fun foo() {} }", Modality.FINAL); + tc.testFunctionModalityInEnum("open enum class A : C { ; open override fun foo() {} }", Modality.OPEN); + tc.testFunctionModalityInEnum("abstract enum class A : C { ; open override fun foo() }", Modality.OPEN); + tc.testFunctionModalityInEnum("abstract enum class A : C { ; abstract override fun foo() }", Modality.ABSTRACT); tc.testFunctionModalityInTrait("trait A : C { override fun foo() }", Modality.ABSTRACT); tc.testFunctionModalityInTrait("trait A : C { abstract override fun foo() }", Modality.ABSTRACT); @@ -287,13 +287,13 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testPropertyModalityInClass("abstract class A { open val a: Int = 0 }", Modality.OPEN); tc.testPropertyModalityInClass("abstract class A { abstract val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInEnum("enum class A { val a: Int = 0 }", Modality.FINAL); - tc.testPropertyModalityInEnum("enum class A { final val a: Int = 0 }", Modality.FINAL); - tc.testPropertyModalityInEnum("open enum class A { val a: Int = 0 }", Modality.FINAL); - tc.testPropertyModalityInEnum("open enum class A { final val a: Int = 0 }", Modality.FINAL); - tc.testPropertyModalityInEnum("open enum class A { open val a: Int = 0 }", Modality.OPEN); - tc.testPropertyModalityInEnum("abstract enum class A { open val a: Int = 0 }", Modality.OPEN); - tc.testPropertyModalityInEnum("abstract enum class A { abstract val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInEnum("enum class A { ; val a: Int = 0 }", Modality.FINAL); + tc.testPropertyModalityInEnum("enum class A { ; final val a: Int = 0 }", Modality.FINAL); + tc.testPropertyModalityInEnum("open enum class A { ; val a: Int = 0 }", Modality.FINAL); + tc.testPropertyModalityInEnum("open enum class A { ; final val a: Int = 0 }", Modality.FINAL); + tc.testPropertyModalityInEnum("open enum class A { ; open val a: Int = 0 }", Modality.OPEN); + tc.testPropertyModalityInEnum("abstract enum class A { ; open val a: Int = 0 }", Modality.OPEN); + tc.testPropertyModalityInEnum("abstract enum class A { ; abstract val a: Int }", Modality.ABSTRACT); tc.testPropertyModalityInTrait("trait A { val a: Int }", Modality.ABSTRACT); tc.testPropertyModalityInTrait("trait A { open val a: Int }", Modality.ABSTRACT); @@ -319,13 +319,13 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testPropertyModalityInClass("abstract class A : C { open override val a: Int = 0 }", Modality.OPEN); tc.testPropertyModalityInClass("abstract class A : C { abstract override val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInEnum("enum class A : C { override val a: Int = 0 }", Modality.OPEN); - tc.testPropertyModalityInEnum("enum class A : C { final override val a: Int = 0 }", Modality.FINAL); - tc.testPropertyModalityInEnum("open enum class A : C { override val a: Int = 0 }", Modality.OPEN); - tc.testPropertyModalityInEnum("open enum class A : C { final override val a: Int = 0 }", Modality.FINAL); - tc.testPropertyModalityInEnum("open enum class A : C { open override val a: Int = 0 }", Modality.OPEN); - tc.testPropertyModalityInEnum("abstract enum class A : C { open override val a: Int = 0 }", Modality.OPEN); - tc.testPropertyModalityInEnum("abstract enum class A : C { abstract override val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInEnum("enum class A : C { ; override val a: Int = 0 }", Modality.OPEN); + tc.testPropertyModalityInEnum("enum class A : C { ; final override val a: Int = 0 }", Modality.FINAL); + tc.testPropertyModalityInEnum("open enum class A : C { ; override val a: Int = 0 }", Modality.OPEN); + tc.testPropertyModalityInEnum("open enum class A : C { ; final override val a: Int = 0 }", Modality.FINAL); + tc.testPropertyModalityInEnum("open enum class A : C { ; open override val a: Int = 0 }", Modality.OPEN); + tc.testPropertyModalityInEnum("abstract enum class A : C { ; open override val a: Int = 0 }", Modality.OPEN); + tc.testPropertyModalityInEnum("abstract enum class A : C { ; abstract override val a: Int }", Modality.ABSTRACT); tc.testPropertyModalityInTrait("trait A : C { override val a: Int }", Modality.ABSTRACT); tc.testPropertyModalityInTrait("trait A : C { open override val a: Int }", Modality.ABSTRACT); diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt index 7b3b647804f..fc7f013d245 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt @@ -82,8 +82,6 @@ public class KotlinCleanupInspection(): LocalInspectionTool(), CleanupLocalInspe private val cleanupDiagnosticsFactories = setOf( Errors.DEPRECATED_TRAIT_KEYWORD, - Errors.ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER, - Errors.ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR, Errors.DEPRECATED_LAMBDA_SYNTAX, Errors.MISSING_CONSTRUCTOR_KEYWORD, Errors.FUNCTION_EXPRESSION_WITH_NAME, diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedEnumEntryDelimiterSyntaxFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedEnumEntryDelimiterSyntaxFix.kt deleted file mode 100644 index db0d842e11a..00000000000 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedEnumEntryDelimiterSyntaxFix.kt +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.idea.quickfix - -import com.intellij.codeInsight.intention.IntentionAction -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.project.Project -import com.intellij.psi.* -import org.jetbrains.kotlin.diagnostics.Diagnostic -import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionFactory -import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionForFirstParentOfType -import org.jetbrains.kotlin.lexer.JetTokens -import org.jetbrains.kotlin.psi -import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.psi.psiUtil.getChildOfType -import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType -import org.jetbrains.kotlin.psi.psiUtil.getNextSiblingIgnoringWhitespaceAndComments -import org.jetbrains.kotlin.psi.stubs.elements.JetStubElementTypes -import org.jetbrains.kotlin.resolve.DeclarationsChecker - -class DeprecatedEnumEntryDelimiterSyntaxFix(element: JetEnumEntry): JetIntentionAction(element), CleanupFix { - - override fun getFamilyName(): String = getText() - - override fun getText(): String = "Insert lacking comma(s) / semicolon(s)" - - override fun invoke(project: Project, editor: Editor?, file: JetFile) = insertLackingCommaSemicolon(element) - - override fun isAvailable(project: Project, editor: Editor?, file: PsiFile): Boolean - = super.isAvailable(project, editor, file) && DeclarationsChecker.enumEntryUsesDeprecatedOrNoDelimiter(element) - - companion object : JetSingleIntentionActionFactory() { - override fun createAction(diagnostic: Diagnostic): IntentionAction? = - diagnostic.createIntentionForFirstParentOfType(::DeprecatedEnumEntryDelimiterSyntaxFix) - - public fun createWholeProjectFixFactory(): JetSingleIntentionActionFactory = createIntentionFactory { - JetWholeProjectForEachElementOfTypeFix.createByPredicate( - predicate = { DeclarationsChecker.enumEntryUsesDeprecatedOrNoDelimiter(it) }, - taskProcessor = { insertLackingCommaSemicolon(it) }, - name = "Insert lacking comma(s) / semicolon(s) in the whole project" - ) - } - - private fun insertLackingCommaSemicolon(enumEntry: JetEnumEntry) { - val body = enumEntry.getParent() as JetClassBody - val entries = body.getChildrenOfType() - val psiFactory = JetPsiFactory(body) - for ((entryIndex, entry) in entries.withIndex()) { - var next = entry.getNextSiblingIgnoringWhitespaceAndComments() - var nextType = next?.getNode()?.getElementType() - var added = false - if (entryIndex < entries.size() - 1) { - if (next is PsiErrorElement && next.getFirstChild()?.getNode()?.getElementType() == JetTokens.SEMICOLON) { - // Fix for syntax error like ENUM_ENTRY1; ENUM_ENTRY2; ENUM_ENTRY3 - next.replace(psiFactory.createComma()) - } - else if (nextType != JetTokens.COMMA) { - // Classic case like ENUM_ENTRY1 ENUM_ENTRY2 - body.addAfter(psiFactory.createComma(), entry) - added = true - } - } - else { - if (nextType == JetTokens.COMMA) { - // ENUM_ENTRY_LAST, fun foo() - next!!.replace(psiFactory.createSemicolon()) - } - else if (nextType != JetTokens.SEMICOLON && nextType != JetTokens.RBRACE) { - // ENUM_ENTRY_LAST fun foo() - body.addAfter(psiFactory.createSemicolon(), entry) - added = true - } - } - // Specific situation: ENTRY // comment ==> ENTRY, // comment, not ENTRY // comment, - if (added) { - val last = entry.getLastChild() - var curr = last - while (curr is PsiComment || curr is PsiWhiteSpace) { - // After comma / semicolon - val prev = curr.getPrevSibling() - body.addAfter(curr, entry.getNextSibling()) - curr = prev - } - if (curr !== last) { - entry.deleteChildRange(curr.getNextSibling()!!, last) - } - } - } - } - } -} \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedEnumEntrySuperConstructorSyntaxFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedEnumEntrySuperConstructorSyntaxFix.kt deleted file mode 100644 index b7d52f8d906..00000000000 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedEnumEntrySuperConstructorSyntaxFix.kt +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.idea.quickfix - -import com.intellij.codeInsight.intention.IntentionAction -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.project.Project -import com.intellij.psi.PsiComment -import com.intellij.psi.PsiElement -import com.intellij.psi.PsiFile -import com.intellij.psi.PsiWhiteSpace -import org.jetbrains.annotations.NotNull -import org.jetbrains.kotlin.JetNodeTypes -import org.jetbrains.kotlin.diagnostics.Diagnostic -import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionFactory -import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionForFirstParentOfType -import org.jetbrains.kotlin.lexer.JetTokens -import org.jetbrains.kotlin.psi -import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.psi.psiUtil.getChildOfType -import org.jetbrains.kotlin.psi.psiUtil.getNextSiblingIgnoringWhitespaceAndComments -import org.jetbrains.kotlin.psi.stubs.elements.JetStubElementTypes -import org.jetbrains.kotlin.resolve.DeclarationsChecker - -class DeprecatedEnumEntrySuperConstructorSyntaxFix(element: JetEnumEntry): JetIntentionAction(element), CleanupFix { - override fun getFamilyName(): String = getText() - - override fun getText(): String = "Change to short enum entry super constructor" - - override fun invoke(project: Project, editor: Editor?, file: JetFile) = changeConstructorToShort(element) - - override fun isAvailable(project: Project, editor: Editor?, file: PsiFile): Boolean - = super.isAvailable(project, editor, file) && DeclarationsChecker.enumEntryUsesDeprecatedSuperConstructor(element) - - companion object: JetSingleIntentionActionFactory() { - override fun createAction(diagnostic: Diagnostic): IntentionAction? = - diagnostic.createIntentionForFirstParentOfType(::DeprecatedEnumEntrySuperConstructorSyntaxFix) - - public fun createWholeProjectFixFactory(): JetSingleIntentionActionFactory = createIntentionFactory { - JetWholeProjectForEachElementOfTypeFix.createByPredicate( - predicate = { DeclarationsChecker.enumEntryUsesDeprecatedSuperConstructor(it) }, - taskProcessor = { changeConstructorToShort(it) }, - name = "Change to short enum entry super constructor in the whole project" - ) - } - - private fun transformInitializerList(list: JetInitializerList) { - val psiFactory = JetPsiFactory(list) - val userType = list.getInitializers()[0].getTypeReference()!!.getTypeElement() as JetUserType - userType.getReferenceExpression()!!.replace(psiFactory.createEnumEntrySuperclassReferenceExpression()) - } - - private fun changeConstructorToShort(entry: JetEnumEntry) { - val list = entry.getInitializerList()!! - transformInitializerList(list) - // Delete everything between name identifier and initializer (colon with whitespaces) - val name = entry.getNameAsDeclaration()!! - entry.deleteChildRange(name.getNextSibling()!!, list.getPrevSibling()!!) - } - } -} \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt index 75efc52f5ad..da10e5a0e88 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt @@ -300,12 +300,6 @@ public class QuickFixRegistrar : QuickFixContributor { DEPRECATED_ANNOTATION_METHOD_CALL.registerFactory(MigrateAnnotationMethodCallFix, MigrateAnnotationMethodCallInWholeFile) - ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR.registerFactory(DeprecatedEnumEntrySuperConstructorSyntaxFix, - DeprecatedEnumEntrySuperConstructorSyntaxFix.createWholeProjectFixFactory()) - - ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER.registerFactory(DeprecatedEnumEntryDelimiterSyntaxFix, - DeprecatedEnumEntryDelimiterSyntaxFix.createWholeProjectFixFactory()) - MISSING_CONSTRUCTOR_KEYWORD.registerFactory(MissingConstructorKeywordFix, MissingConstructorKeywordFix.createWholeProjectFixFactory()) diff --git a/idea/testData/decompiler/navigation/decompiled/Color.kt b/idea/testData/decompiler/navigation/decompiled/Color.kt index 47361b7eb3a..0a77e11b548 100644 --- a/idea/testData/decompiler/navigation/decompiled/Color.kt +++ b/idea/testData/decompiler/navigation/decompiled/Color.kt @@ -4,11 +4,11 @@ package testData.libraries [[public final enum class Color private constructor(rgb: kotlin.Int) : kotlin.Enum { - [[RED]], + [[RED,]] - [[GREEN]], + [[GREEN,]] - [[BLUE]]; + [[BLUE;]] [internal final val rgb: kotlin.Int /* compiled code */] }]] \ No newline at end of file diff --git a/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt b/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt index c31b050a45a..cbe418b2a60 100644 --- a/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt +++ b/idea/testData/formatter/EmptyLineAfterObjectDeclaration.after.kt @@ -30,6 +30,7 @@ interface T1 enum class E1 { ENTRY; + object O7 } @@ -67,6 +68,7 @@ interface T2 enum class E2 { ENTRY; + object O14 {} } @@ -109,6 +111,7 @@ interface T3 enum class E3 { ENTRY; + object O21 { } } diff --git a/idea/testData/formatter/EmptyLineBetweenEnumEntries.after.kt b/idea/testData/formatter/EmptyLineBetweenEnumEntries.after.kt index 1ed633c2c8e..b09ccd2a0fd 100644 --- a/idea/testData/formatter/EmptyLineBetweenEnumEntries.after.kt +++ b/idea/testData/formatter/EmptyLineBetweenEnumEntries.after.kt @@ -23,5 +23,6 @@ enum class E6 { enum class E7 { F { - }, S, T + }, + S, T } \ No newline at end of file diff --git a/idea/testData/formatter/SpaceAroundExtendColonInEnums.after.inv.kt b/idea/testData/formatter/SpaceAroundExtendColonInEnums.after.inv.kt deleted file mode 100644 index 41ed08133f7..00000000000 --- a/idea/testData/formatter/SpaceAroundExtendColonInEnums.after.inv.kt +++ /dev/null @@ -1,10 +0,0 @@ -enum class Test: A { - FIRST: Test() - SECOND: - Test() - - THIRD: Test() FORTH: Test() -} - -// SET_TRUE: SPACE_BEFORE_EXTEND_COLON -// SET_FALSE: SPACE_AFTER_EXTEND_COLON diff --git a/idea/testData/formatter/SpaceAroundExtendColonInEnums.after.kt b/idea/testData/formatter/SpaceAroundExtendColonInEnums.after.kt deleted file mode 100644 index 69b6f4a8ede..00000000000 --- a/idea/testData/formatter/SpaceAroundExtendColonInEnums.after.kt +++ /dev/null @@ -1,10 +0,0 @@ -enum class Test :A { - FIRST :Test() - SECOND : - Test() - - THIRD :Test() FORTH :Test() -} - -// SET_TRUE: SPACE_BEFORE_EXTEND_COLON -// SET_FALSE: SPACE_AFTER_EXTEND_COLON diff --git a/idea/testData/formatter/SpaceAroundExtendColonInEnums.kt b/idea/testData/formatter/SpaceAroundExtendColonInEnums.kt deleted file mode 100644 index 2c09f554541..00000000000 --- a/idea/testData/formatter/SpaceAroundExtendColonInEnums.kt +++ /dev/null @@ -1,10 +0,0 @@ -enum class Test : A { - FIRST : Test() - SECOND: - Test() - - THIRD: Test() FORTH: Test() -} - -// SET_TRUE: SPACE_BEFORE_EXTEND_COLON -// SET_FALSE: SPACE_AFTER_EXTEND_COLON diff --git a/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.inv.kt b/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.inv.kt deleted file mode 100644 index c96a5888b21..00000000000 --- a/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.inv.kt +++ /dev/null @@ -1,8 +0,0 @@ -// SET_TRUE: ALIGN_MULTILINE_EXTENDS_LIST - -interface A1 - -enum class EnumTest { - ENTRY: - -} diff --git a/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.kt b/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.kt deleted file mode 100644 index c96a5888b21..00000000000 --- a/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.kt +++ /dev/null @@ -1,8 +0,0 @@ -// SET_TRUE: ALIGN_MULTILINE_EXTENDS_LIST - -interface A1 - -enum class EnumTest { - ENTRY: - -} diff --git a/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.kt b/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.kt deleted file mode 100644 index d7ca1e4ee5d..00000000000 --- a/idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.kt +++ /dev/null @@ -1,7 +0,0 @@ -// SET_TRUE: ALIGN_MULTILINE_EXTENDS_LIST - -interface A1 - -enum class EnumTest { - ENTRY: -} diff --git a/idea/testData/inspections/cleanup/cleanup.kt b/idea/testData/inspections/cleanup/cleanup.kt index e4a18143d99..11980332fc3 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt +++ b/idea/testData/inspections/cleanup/cleanup.kt @@ -1,15 +1,6 @@ trait Foo { } -enum class E { - First Second -} - -enum class F(val name: String) { - First: F("First") - Second: F("Second") -} - val f = { (a: Int, b: Int) -> a + b } class A private() diff --git a/idea/testData/inspections/cleanup/cleanup.kt.after b/idea/testData/inspections/cleanup/cleanup.kt.after index 38fbd103a9e..00dd7ff4a2c 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt.after +++ b/idea/testData/inspections/cleanup/cleanup.kt.after @@ -1,15 +1,6 @@ interface Foo { } -enum class E { - First, Second -} - -enum class F(val name: String) { - First("First"), - Second("Second") -} - val f = { a: Int, b: Int -> a + b } class A private constructor() diff --git a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerFirst.kt b/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerFirst.kt deleted file mode 100644 index 419d4ad506c..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerFirst.kt +++ /dev/null @@ -1,8 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class MyEnum(val z: Int) { - A: MyEnum(3) - B(7) - C(12) - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerFirst.kt.after b/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerFirst.kt.after deleted file mode 100644 index 92d6cb59538..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerFirst.kt.after +++ /dev/null @@ -1,8 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class MyEnum(val z: Int) { - A(3) - B(7) - C(12) - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerLast.kt b/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerLast.kt deleted file mode 100644 index 2345cc9fa3c..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerLast.kt +++ /dev/null @@ -1,8 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class MyEnum(val z: Int) { - A(3) - B(7) - C: MyEnum(12) - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerLast.kt.after b/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerLast.kt.after deleted file mode 100644 index 92d6cb59538..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerLast.kt.after +++ /dev/null @@ -1,8 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class MyEnum(val z: Int) { - A(3) - B(7) - C(12) - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingAnnotation.kt b/idea/testData/quickfix/migration/enumConstructor/precedingAnnotation.kt deleted file mode 100644 index f819cecf540..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingAnnotation.kt +++ /dev/null @@ -1,11 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -annotation class My -annotation class Your -annotation class His - -enum class MyEnum(val i: Int) { - @My FIRST: MyEnum(1), - @My @Your SECOND: MyEnum(2), - @Your @His THIRD: MyEnum(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingAnnotation.kt.after b/idea/testData/quickfix/migration/enumConstructor/precedingAnnotation.kt.after deleted file mode 100644 index 38a0d3c5e09..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingAnnotation.kt.after +++ /dev/null @@ -1,11 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -annotation class My -annotation class Your -annotation class His - -enum class MyEnum(val i: Int) { - @My FIRST(1), - @My @Your SECOND(2), - @Your @His THIRD(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingComment.kt b/idea/testData/quickfix/migration/enumConstructor/precedingComment.kt deleted file mode 100644 index 6a4008170d3..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingComment.kt +++ /dev/null @@ -1,10 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class MyEnum(val i: Int) { - // The first - FIRST: MyEnum(1), - // The second - SECOND: MyEnum(2), - // The third - THIRD: MyEnum(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingComment.kt.after b/idea/testData/quickfix/migration/enumConstructor/precedingComment.kt.after deleted file mode 100644 index 53995112965..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingComment.kt.after +++ /dev/null @@ -1,10 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class MyEnum(val i: Int) { - // The first - FIRST(1), - // The second - SECOND(2), - // The third - THIRD(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingDocComment.kt b/idea/testData/quickfix/migration/enumConstructor/precedingDocComment.kt deleted file mode 100644 index 9ab019aac42..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingDocComment.kt +++ /dev/null @@ -1,16 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class MyEnum(val i: Int) { - /** - * The first - */ - FIRST: MyEnum(1), - /** - * The second - */ - SECOND: MyEnum(2), - /** - * The third - */ - THIRD: MyEnum(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingDocComment.kt.after b/idea/testData/quickfix/migration/enumConstructor/precedingDocComment.kt.after deleted file mode 100644 index 6c42d247267..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingDocComment.kt.after +++ /dev/null @@ -1,16 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class MyEnum(val i: Int) { - /** - * The first - */ - FIRST(1), - /** - * The second - */ - SECOND(2), - /** - * The third - */ - THIRD(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingMultilineComment.kt b/idea/testData/quickfix/migration/enumConstructor/precedingMultilineComment.kt deleted file mode 100644 index 6ab0c0492f4..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingMultilineComment.kt +++ /dev/null @@ -1,13 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class MyEnum(val i: Int) { - // The - // first - FIRST: MyEnum(1), - // The - // second - SECOND: MyEnum(2), - // The - // third - THIRD: MyEnum(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/precedingMultilineComment.kt.after b/idea/testData/quickfix/migration/enumConstructor/precedingMultilineComment.kt.after deleted file mode 100644 index 1f33aa8a525..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/precedingMultilineComment.kt.after +++ /dev/null @@ -1,13 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class MyEnum(val i: Int) { - // The - // first - FIRST(1), - // The - // second - SECOND(2), - // The - // third - THIRD(3) -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/singleEntry.kt b/idea/testData/quickfix/migration/enumConstructor/singleEntry.kt deleted file mode 100644 index a2a87402e19..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/singleEntry.kt +++ /dev/null @@ -1,5 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String) { - UNIQUE: SimpleEnum("42") -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/singleEntry.kt.after b/idea/testData/quickfix/migration/enumConstructor/singleEntry.kt.after deleted file mode 100644 index 06430d47cd0..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/singleEntry.kt.after +++ /dev/null @@ -1,5 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String) { - UNIQUE("42") -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/wholeProject.kt b/idea/testData/quickfix/migration/enumConstructor/wholeProject.kt deleted file mode 100644 index f469abda2e6..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/wholeProject.kt +++ /dev/null @@ -1,24 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class First(val colorCode: Int) { - RED: First(0xff0000), - GREEN: First(0x00ff00), BLUE: First(0x0000ff) -} - -enum class Second(val dirCode: Int) { - NORTH: Second(1) { - override fun dir(): String = "N" - }, - SOUTH: Second(2) { - override fun dir(): String = "S" - }, - WEST : Second(3) { - override fun dir(): String = "W" - }, - EAST: Second(4) { - override fun dir(): String = "E" - }; - - - abstract fun dir(): String -} diff --git a/idea/testData/quickfix/migration/enumConstructor/wholeProject.kt.after b/idea/testData/quickfix/migration/enumConstructor/wholeProject.kt.after deleted file mode 100644 index 8366e0f3d0c..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/wholeProject.kt.after +++ /dev/null @@ -1,24 +0,0 @@ -// "Change to short enum entry super constructor in the whole project" "true" - -enum class First(val colorCode: Int) { - RED(0xff0000), - GREEN(0x00ff00), BLUE(0x0000ff) -} - -enum class Second(val dirCode: Int) { - NORTH(1) { - override fun dir(): String = "N" - }, - SOUTH(2) { - override fun dir(): String = "S" - }, - WEST(3) { - override fun dir(): String = "W" - }, - EAST(4) { - override fun dir(): String = "E" - }; - - - abstract fun dir(): String -} diff --git a/idea/testData/quickfix/migration/enumConstructor/withCommas.kt b/idea/testData/quickfix/migration/enumConstructor/withCommas.kt deleted file mode 100644 index a466e08dd30..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/withCommas.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String = "xxx") { - FIRST(), - SECOND: SimpleEnum("42"), - LAST("13"); - - fun foo() = z -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/withCommas.kt.after b/idea/testData/quickfix/migration/enumConstructor/withCommas.kt.after deleted file mode 100644 index 987bb1835ba..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/withCommas.kt.after +++ /dev/null @@ -1,9 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String = "xxx") { - FIRST(), - SECOND("42"), - LAST("13"); - - fun foo() = z -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/withNamedArgument.kt b/idea/testData/quickfix/migration/enumConstructor/withNamedArgument.kt deleted file mode 100644 index 9062c3cbb45..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/withNamedArgument.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String = "xxx") { - FIRST(), - SECOND: SimpleEnum(z = "42"), - LAST("13"); - - fun foo() = z -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/withNamedArgument.kt.after b/idea/testData/quickfix/migration/enumConstructor/withNamedArgument.kt.after deleted file mode 100644 index 56e8b8d06c5..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/withNamedArgument.kt.after +++ /dev/null @@ -1,9 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String = "xxx") { - FIRST(), - SECOND(z = "42"), - LAST("13"); - - fun foo() = z -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/withOverloads.kt b/idea/testData/quickfix/migration/enumConstructor/withOverloads.kt deleted file mode 100644 index d42f249eb13..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/withOverloads.kt +++ /dev/null @@ -1,13 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String = "xxx") { - FIRST: SimpleEnum() { - override fun foo(): String = "abc" - }, - SECOND() { - override fun foo(): String = "xyz" - }, - LAST("13"); - - open fun foo(): String = z -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumConstructor/withOverloads.kt.after b/idea/testData/quickfix/migration/enumConstructor/withOverloads.kt.after deleted file mode 100644 index e4033e0b3ea..00000000000 --- a/idea/testData/quickfix/migration/enumConstructor/withOverloads.kt.after +++ /dev/null @@ -1,13 +0,0 @@ -// "Change to short enum entry super constructor" "true" - -enum class SimpleEnum(val z: String = "xxx") { - FIRST() { - override fun foo(): String = "abc" - }, - SECOND() { - override fun foo(): String = "xyz" - }, - LAST("13"); - - open fun foo(): String = z -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/commaNoSemicolon.kt b/idea/testData/quickfix/migration/enumDelimiter/commaNoSemicolon.kt deleted file mode 100644 index 9fd019fe926..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/commaNoSemicolon.kt +++ /dev/null @@ -1,7 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, - SECOND, - val zzz = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/commaNoSemicolon.kt.after b/idea/testData/quickfix/migration/enumDelimiter/commaNoSemicolon.kt.after deleted file mode 100644 index 234381e704e..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/commaNoSemicolon.kt.after +++ /dev/null @@ -1,7 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, - SECOND; - val zzz = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/commaSemicolonDelimiter.kt b/idea/testData/quickfix/migration/enumDelimiter/commaSemicolonDelimiter.kt deleted file mode 100644 index 3c743725856..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/commaSemicolonDelimiter.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A, B; C D, - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/commaSemicolonDelimiter.kt.after b/idea/testData/quickfix/migration/enumDelimiter/commaSemicolonDelimiter.kt.after deleted file mode 100644 index 8cfac6011cb..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/commaSemicolonDelimiter.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A, B, C, D; - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/missedCommas.kt b/idea/testData/quickfix/migration/enumDelimiter/missedCommas.kt deleted file mode 100644 index b04dd6a8061..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/missedCommas.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST SECOND, - THIRD - FOURTH FIFTH SIXTH, - SEVENTH EIGHTH - -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/missedCommas.kt.after b/idea/testData/quickfix/migration/enumDelimiter/missedCommas.kt.after deleted file mode 100644 index 3cbca1eba0d..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/missedCommas.kt.after +++ /dev/null @@ -1,9 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, SECOND, - THIRD, - FOURTH, FIFTH, SIXTH, - SEVENTH, EIGHTH - -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noComma.kt b/idea/testData/quickfix/migration/enumDelimiter/noComma.kt deleted file mode 100644 index 42a2ad64cfb..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noComma.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST SECOND - -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noComma.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noComma.kt.after deleted file mode 100644 index ab5e5d901bb..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noComma.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, SECOND - -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaComment.kt b/idea/testData/quickfix/migration/enumDelimiter/noCommaComment.kt deleted file mode 100644 index 8ef0acb1f96..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaComment.kt +++ /dev/null @@ -1,8 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST - /* The first one */ - SECOND - /* The last one */ -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaComment.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noCommaComment.kt.after deleted file mode 100644 index 9db271c5e5e..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaComment.kt.after +++ /dev/null @@ -1,8 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, - /* The first one */ - SECOND - /* The last one */ -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithBracketComment.kt b/idea/testData/quickfix/migration/enumDelimiter/noCommaWithBracketComment.kt deleted file mode 100644 index 2604f2f5e80..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithBracketComment.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST /* The first one */ - SECOND -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithBracketComment.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noCommaWithBracketComment.kt.after deleted file mode 100644 index e7d4a178162..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithBracketComment.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, /* The first one */ - SECOND -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithComment.kt b/idea/testData/quickfix/migration/enumDelimiter/noCommaWithComment.kt deleted file mode 100644 index fd68c30add7..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithComment.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST // The first one - SECOND -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithComment.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noCommaWithComment.kt.after deleted file mode 100644 index d807bc49ba7..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithComment.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, // The first one - SECOND -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithTwoComments.kt b/idea/testData/quickfix/migration/enumDelimiter/noCommaWithTwoComments.kt deleted file mode 100644 index 153dc02e251..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithTwoComments.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST /* The first one */ // It's really important - SECOND -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithTwoComments.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noCommaWithTwoComments.kt.after deleted file mode 100644 index 7e622d5c6cb..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noCommaWithTwoComments.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, /* The first one */ // It's really important - SECOND -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiter.kt b/idea/testData/quickfix/migration/enumDelimiter/noDelimiter.kt deleted file mode 100644 index 812d520bb40..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiter.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A B C D E F G H I J - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiter.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noDelimiter.kt.after deleted file mode 100644 index 116f94b835b..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiter.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A, B, C, D, E, F, G, H, I, J; - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithInitializer.kt b/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithInitializer.kt deleted file mode 100644 index 9bc5a6b12f3..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithInitializer.kt +++ /dev/null @@ -1,8 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum(val z: Int) { - A: MyEnum(3) - B: MyEnum(7) - C: MyEnum(12) - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithInitializer.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithInitializer.kt.after deleted file mode 100644 index afa76b0e906..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithInitializer.kt.after +++ /dev/null @@ -1,8 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum(val z: Int) { - A: MyEnum(3), - B: MyEnum(7), - C: MyEnum(12); - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithOverload.kt b/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithOverload.kt deleted file mode 100644 index 58c5b976d04..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithOverload.kt +++ /dev/null @@ -1,11 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A { - override fun foo(): Int = 13 - } - B C { - override fun foo(): Int = 23 - } - open fun foo(): Int = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithOverload.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithOverload.kt.after deleted file mode 100644 index 3ef441c6f9b..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithOverload.kt.after +++ /dev/null @@ -1,11 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A { - override fun foo(): Int = 13 - }, - B, C { - override fun foo(): Int = 23 - }; - open fun foo(): Int = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithShortConstructor.kt b/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithShortConstructor.kt deleted file mode 100644 index 403ee676261..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithShortConstructor.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum(val z: Int) { - A(3) B(7) C(12) - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithShortConstructor.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithShortConstructor.kt.after deleted file mode 100644 index ca22714ef73..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithShortConstructor.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum(val z: Int) { - A(3), B(7), C(12); - fun foo() = z * 2 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noSemicolon.kt b/idea/testData/quickfix/migration/enumDelimiter/noSemicolon.kt deleted file mode 100644 index 2dc1793e758..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noSemicolon.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, SECOND - val zzz = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noSemicolon.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noSemicolon.kt.after deleted file mode 100644 index b70278c6463..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noSemicolon.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, SECOND; - val zzz = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noSemicolonComment.kt b/idea/testData/quickfix/migration/enumDelimiter/noSemicolonComment.kt deleted file mode 100644 index e6db561f7ce..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noSemicolonComment.kt +++ /dev/null @@ -1,7 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, SECOND - /* The last one*/ - fun foo() = 1 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/noSemicolonComment.kt.after b/idea/testData/quickfix/migration/enumDelimiter/noSemicolonComment.kt.after deleted file mode 100644 index bf80840adc3..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/noSemicolonComment.kt.after +++ /dev/null @@ -1,7 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - FIRST, SECOND; - /* The last one*/ - fun foo() = 1 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiter.kt b/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiter.kt deleted file mode 100644 index f3e9bf0e0d3..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiter.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A; B; C; D; - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiter.kt.after b/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiter.kt.after deleted file mode 100644 index b247ee9c031..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiter.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A, B, C, D; - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiterExceptLast.kt b/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiterExceptLast.kt deleted file mode 100644 index 937dd48a88d..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiterExceptLast.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A; B; C; D - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiterExceptLast.kt.after b/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiterExceptLast.kt.after deleted file mode 100644 index 8cfac6011cb..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiterExceptLast.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s)" "true" - -enum class MyEnum { - A, B, C, D; - fun foo() = 42 -} \ No newline at end of file diff --git a/idea/testData/quickfix/migration/enumDelimiter/wholeProject.kt b/idea/testData/quickfix/migration/enumDelimiter/wholeProject.kt deleted file mode 100644 index 5712b712499..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/wholeProject.kt +++ /dev/null @@ -1,22 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s) in the whole project" "true" - -enum class First { - RED GREEN, - BLUE -} - -enum class Second(val code: Int) { - NORTH(2) SOUTH(4), - EAST(6) WEST(8) -} - -enum class Third { - OK { - override fun diag(): String = "OK" - } - ERROR { - override fun diag(): String = "Failed" - } - - open fun diag(): String = "" -} diff --git a/idea/testData/quickfix/migration/enumDelimiter/wholeProject.kt.after b/idea/testData/quickfix/migration/enumDelimiter/wholeProject.kt.after deleted file mode 100644 index 55fe1081887..00000000000 --- a/idea/testData/quickfix/migration/enumDelimiter/wholeProject.kt.after +++ /dev/null @@ -1,22 +0,0 @@ -// "Insert lacking comma(s) / semicolon(s) in the whole project" "true" - -enum class First { - RED, GREEN, - BLUE -} - -enum class Second(val code: Int) { - NORTH(2), SOUTH(4), - EAST(6), WEST(8) -} - -enum class Third { - OK { - override fun diag(): String = "OK" - }, - ERROR { - override fun diag(): String = "Failed" - }; - - open fun diag(): String = "" -} diff --git a/idea/tests/org/jetbrains/kotlin/formatter/JetFormatterTestGenerated.java b/idea/tests/org/jetbrains/kotlin/formatter/JetFormatterTestGenerated.java index 161618818f9..dbca96cc0c4 100644 --- a/idea/tests/org/jetbrains/kotlin/formatter/JetFormatterTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/formatter/JetFormatterTestGenerated.java @@ -451,12 +451,6 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest { doTest(fileName); } - @TestMetadata("SpaceAroundExtendColonInEnums.after.kt") - public void testSpaceAroundExtendColonInEnums() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/SpaceAroundExtendColonInEnums.after.kt"); - doTest(fileName); - } - @TestMetadata("SpaceAroundExtendColonInObjects.after.kt") public void testSpaceAroundExtendColonInObjects() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/SpaceAroundExtendColonInObjects.after.kt"); @@ -868,12 +862,6 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest { doTestInverted(fileName); } - @TestMetadata("SpaceAroundExtendColonInEnums.after.inv.kt") - public void testSpaceAroundExtendColonInEnums() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/SpaceAroundExtendColonInEnums.after.inv.kt"); - doTestInverted(fileName); - } - @TestMetadata("SpaceAroundExtendColonInObjects.after.inv.kt") public void testSpaceAroundExtendColonInObjects() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/formatter/SpaceAroundExtendColonInObjects.after.inv.kt"); diff --git a/idea/tests/org/jetbrains/kotlin/formatter/JetTypingIndentationTestBaseGenerated.java b/idea/tests/org/jetbrains/kotlin/formatter/JetTypingIndentationTestBaseGenerated.java index cc1537fdbb7..4fa0b778bbe 100644 --- a/idea/tests/org/jetbrains/kotlin/formatter/JetTypingIndentationTestBaseGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/formatter/JetTypingIndentationTestBaseGenerated.java @@ -175,12 +175,6 @@ public class JetTypingIndentationTestBaseGenerated extends AbstractJetTypingInde doNewlineTest(fileName); } - @TestMetadata("InEnumInitializerListAfterColon.after.kt") - public void testInEnumInitializerListAfterColon() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.kt"); - doNewlineTest(fileName); - } - @TestMetadata("InEnumInitializerListAfterComma.after.kt") public void testInEnumInitializerListAfterComma() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/indentationOnNewline/InEnumInitializerListAfterComma.after.kt"); @@ -397,12 +391,6 @@ public class JetTypingIndentationTestBaseGenerated extends AbstractJetTypingInde doNewlineTestWithInvert(fileName); } - @TestMetadata("InEnumInitializerListAfterColon.after.inv.kt") - public void testInEnumInitializerListAfterColon() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/indentationOnNewline/InEnumInitializerListAfterColon.after.inv.kt"); - doNewlineTestWithInvert(fileName); - } - @TestMetadata("InEnumInitializerListAfterComma.after.inv.kt") public void testInEnumInitializerListAfterComma() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/indentationOnNewline/InEnumInitializerListAfterComma.after.inv.kt"); diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index 3919150c7eb..b2d8608a4e1 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -3836,192 +3836,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true); } - @TestMetadata("idea/testData/quickfix/migration/enumConstructor") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class EnumConstructor extends AbstractQuickFixTest { - public void testAllFilesPresentInEnumConstructor() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/enumConstructor"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true); - } - - @TestMetadata("noDelimiterWithInitializerFirst.kt") - public void testNoDelimiterWithInitializerFirst() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerFirst.kt"); - doTest(fileName); - } - - @TestMetadata("noDelimiterWithInitializerLast.kt") - public void testNoDelimiterWithInitializerLast() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/noDelimiterWithInitializerLast.kt"); - doTest(fileName); - } - - @TestMetadata("precedingAnnotation.kt") - public void testPrecedingAnnotation() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/precedingAnnotation.kt"); - doTest(fileName); - } - - @TestMetadata("precedingComment.kt") - public void testPrecedingComment() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/precedingComment.kt"); - doTest(fileName); - } - - @TestMetadata("precedingDocComment.kt") - public void testPrecedingDocComment() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/precedingDocComment.kt"); - doTest(fileName); - } - - @TestMetadata("precedingMultilineComment.kt") - public void testPrecedingMultilineComment() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/precedingMultilineComment.kt"); - doTest(fileName); - } - - @TestMetadata("singleEntry.kt") - public void testSingleEntry() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/singleEntry.kt"); - doTest(fileName); - } - - @TestMetadata("wholeProject.kt") - public void testWholeProject() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/wholeProject.kt"); - doTest(fileName); - } - - @TestMetadata("withCommas.kt") - public void testWithCommas() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/withCommas.kt"); - doTest(fileName); - } - - @TestMetadata("withNamedArgument.kt") - public void testWithNamedArgument() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/withNamedArgument.kt"); - doTest(fileName); - } - - @TestMetadata("withOverloads.kt") - public void testWithOverloads() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumConstructor/withOverloads.kt"); - doTest(fileName); - } - } - - @TestMetadata("idea/testData/quickfix/migration/enumDelimiter") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class EnumDelimiter extends AbstractQuickFixTest { - public void testAllFilesPresentInEnumDelimiter() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/enumDelimiter"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true); - } - - @TestMetadata("commaNoSemicolon.kt") - public void testCommaNoSemicolon() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/commaNoSemicolon.kt"); - doTest(fileName); - } - - @TestMetadata("commaSemicolonDelimiter.kt") - public void testCommaSemicolonDelimiter() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/commaSemicolonDelimiter.kt"); - doTest(fileName); - } - - @TestMetadata("missedCommas.kt") - public void testMissedCommas() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/missedCommas.kt"); - doTest(fileName); - } - - @TestMetadata("noComma.kt") - public void testNoComma() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noComma.kt"); - doTest(fileName); - } - - @TestMetadata("noCommaComment.kt") - public void testNoCommaComment() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noCommaComment.kt"); - doTest(fileName); - } - - @TestMetadata("noCommaWithBracketComment.kt") - public void testNoCommaWithBracketComment() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noCommaWithBracketComment.kt"); - doTest(fileName); - } - - @TestMetadata("noCommaWithComment.kt") - public void testNoCommaWithComment() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noCommaWithComment.kt"); - doTest(fileName); - } - - @TestMetadata("noCommaWithTwoComments.kt") - public void testNoCommaWithTwoComments() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noCommaWithTwoComments.kt"); - doTest(fileName); - } - - @TestMetadata("noDelimiter.kt") - public void testNoDelimiter() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noDelimiter.kt"); - doTest(fileName); - } - - @TestMetadata("noDelimiterWithInitializer.kt") - public void testNoDelimiterWithInitializer() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithInitializer.kt"); - doTest(fileName); - } - - @TestMetadata("noDelimiterWithOverload.kt") - public void testNoDelimiterWithOverload() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithOverload.kt"); - doTest(fileName); - } - - @TestMetadata("noDelimiterWithShortConstructor.kt") - public void testNoDelimiterWithShortConstructor() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noDelimiterWithShortConstructor.kt"); - doTest(fileName); - } - - @TestMetadata("noSemicolon.kt") - public void testNoSemicolon() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noSemicolon.kt"); - doTest(fileName); - } - - @TestMetadata("noSemicolonComment.kt") - public void testNoSemicolonComment() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/noSemicolonComment.kt"); - doTest(fileName); - } - - @TestMetadata("semicolonDelimiter.kt") - public void testSemicolonDelimiter() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiter.kt"); - doTest(fileName); - } - - @TestMetadata("semicolonDelimiterExceptLast.kt") - public void testSemicolonDelimiterExceptLast() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/semicolonDelimiterExceptLast.kt"); - doTest(fileName); - } - - @TestMetadata("wholeProject.kt") - public void testWholeProject() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/enumDelimiter/wholeProject.kt"); - doTest(fileName); - } - } - @TestMetadata("idea/testData/quickfix/migration/lambdaSyntax") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/j2k/testData/fileOrElement/enum/enumWithNameField.kt b/j2k/testData/fileOrElement/enum/enumWithNameField.kt index 7834ad54751..253017b4396 100644 --- a/j2k/testData/fileOrElement/enum/enumWithNameField.kt +++ b/j2k/testData/fileOrElement/enum/enumWithNameField.kt @@ -1,4 +1,5 @@ enum class E { I; + private val name: String? = null } \ No newline at end of file diff --git a/j2k/testData/fileOrElement/enum/overrideToString.kt b/j2k/testData/fileOrElement/enum/overrideToString.kt index 7398b2f16ad..e35942ce9e2 100644 --- a/j2k/testData/fileOrElement/enum/overrideToString.kt +++ b/j2k/testData/fileOrElement/enum/overrideToString.kt @@ -1,5 +1,6 @@ enum class Color { WHITE, BLACK, RED, YELLOW, BLUE; + override fun toString(): String { return "COLOR" }