Enum deprecated syntax detection implemented and integrated into DeclarationsChecker.
A lot of tests was changed to refactor deprecated syntax. Six new tests were added to check deprecated syntax detection. Diagnostic for "enum entry uses deprecated super constructor": constructor is highlighted Diagnostic for "enum entry uses deprecated or no delimiter". One warning removed.
This commit is contained in:
@@ -211,6 +211,8 @@ public interface Errors {
|
|||||||
DiagnosticFactory1<JetClass, ClassDescriptor> ENUM_ENTRY_SHOULD_BE_INITIALIZED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
|
DiagnosticFactory1<JetClass, ClassDescriptor> ENUM_ENTRY_SHOULD_BE_INITIALIZED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
|
||||||
DiagnosticFactory1<JetTypeReference, ClassDescriptor> ENUM_ENTRY_ILLEGAL_TYPE = DiagnosticFactory1.create(ERROR);
|
DiagnosticFactory1<JetTypeReference, ClassDescriptor> ENUM_ENTRY_ILLEGAL_TYPE = DiagnosticFactory1.create(ERROR);
|
||||||
DiagnosticFactory1<JetClass, ClassDescriptor> LOCAL_ENUM_NOT_ALLOWED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
|
DiagnosticFactory1<JetClass, ClassDescriptor> LOCAL_ENUM_NOT_ALLOWED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
|
||||||
|
DiagnosticFactory2<JetEnumEntry, ClassDescriptor, String> ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER = DiagnosticFactory2.create(WARNING, DECLARATION_NAME);
|
||||||
|
DiagnosticFactory1<JetEnumEntry, ClassDescriptor> ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR = DiagnosticFactory1.create(WARNING, DELEGATOR_SUPER_CALL);
|
||||||
|
|
||||||
// Companion objects
|
// Companion objects
|
||||||
|
|
||||||
|
|||||||
@@ -428,4 +428,11 @@ public object PositioningStrategies {
|
|||||||
return markElement(element.getCalleeExpression() ?: element)
|
return markElement(element.getCalleeExpression() ?: element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public val DELEGATOR_SUPER_CALL: PositioningStrategy<JetEnumEntry> = object: PositioningStrategy<JetEnumEntry>() {
|
||||||
|
override fun mark(element: JetEnumEntry): List<TextRange> {
|
||||||
|
val specifiers = element.getDelegationSpecifiers()
|
||||||
|
return markElement(if (specifiers.isEmpty()) element else specifiers[0])
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -257,6 +257,8 @@ public class DefaultErrorMessages {
|
|||||||
|
|
||||||
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(LOCAL_OBJECT_NOT_ALLOWED, "Named object ''{0}'' is a singleton and cannot be local. Try to use anonymous object instead", NAME);
|
||||||
MAP.put(LOCAL_ENUM_NOT_ALLOWED, "Enum class ''{0}'' cannot be local", NAME);
|
MAP.put(LOCAL_ENUM_NOT_ALLOWED, "Enum class ''{0}'' cannot be local", 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(DELEGATION_IN_TRAIT, "Interfaces cannot use delegation");
|
MAP.put(DELEGATION_IN_TRAIT, "Interfaces cannot use delegation");
|
||||||
MAP.put(DELEGATION_NOT_TO_TRAIT, "Only interfaces can be delegated to");
|
MAP.put(DELEGATION_NOT_TO_TRAIT, "Only interfaces can be delegated to");
|
||||||
MAP.put(UNMET_TRAIT_REQUIREMENT, "Super interface ''{0}'' requires subclasses to extend ''{1}''", NAME, NAME);
|
MAP.put(UNMET_TRAIT_REQUIREMENT, "Super interface ''{0}'' requires subclasses to extend ''{1}''", NAME, NAME);
|
||||||
|
|||||||
@@ -99,6 +99,15 @@ inline public fun PsiElement.getChildrenOfType<reified T: PsiElement>(): Array<T
|
|||||||
return PsiTreeUtil.getChildrenOfType(this, javaClass<T>()) ?: array()
|
return PsiTreeUtil.getChildrenOfType(this, javaClass<T>()) ?: array()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public fun PsiElement.getNextSiblingIgnoringWhitespace(): PsiElement {
|
||||||
|
var current = this
|
||||||
|
do {
|
||||||
|
current = current.getNextSibling()
|
||||||
|
}
|
||||||
|
while (current.getNode().getElementType() == JetTokens.WHITE_SPACE)
|
||||||
|
return current
|
||||||
|
}
|
||||||
|
|
||||||
public fun PsiElement?.isAncestor(element: PsiElement, strict: Boolean = false): Boolean {
|
public fun PsiElement?.isAncestor(element: PsiElement, strict: Boolean = false): Boolean {
|
||||||
return PsiTreeUtil.isAncestor(this, element, strict)
|
return PsiTreeUtil.isAncestor(this, element, strict)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ package org.jetbrains.kotlin.resolve;
|
|||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.intellij.lang.ASTNode;
|
import com.intellij.lang.ASTNode;
|
||||||
|
import com.intellij.psi.PsiElement;
|
||||||
|
import com.intellij.psi.tree.IElementType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.kotlin.descriptors.*;
|
import org.jetbrains.kotlin.descriptors.*;
|
||||||
@@ -26,6 +28,7 @@ import org.jetbrains.kotlin.diagnostics.Errors;
|
|||||||
import org.jetbrains.kotlin.lexer.JetModifierKeywordToken;
|
import org.jetbrains.kotlin.lexer.JetModifierKeywordToken;
|
||||||
import org.jetbrains.kotlin.lexer.JetTokens;
|
import org.jetbrains.kotlin.lexer.JetTokens;
|
||||||
import org.jetbrains.kotlin.psi.*;
|
import org.jetbrains.kotlin.psi.*;
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.PsiUtilPackage;
|
||||||
import org.jetbrains.kotlin.types.JetType;
|
import org.jetbrains.kotlin.types.JetType;
|
||||||
import org.jetbrains.kotlin.types.SubstitutionUtils;
|
import org.jetbrains.kotlin.types.SubstitutionUtils;
|
||||||
import org.jetbrains.kotlin.types.TypeConstructor;
|
import org.jetbrains.kotlin.types.TypeConstructor;
|
||||||
@@ -206,6 +209,7 @@ public class DeclarationsChecker {
|
|||||||
DeclarationDescriptor containingDeclaration = typeParameterDescriptor.getContainingDeclaration();
|
DeclarationDescriptor containingDeclaration = typeParameterDescriptor.getContainingDeclaration();
|
||||||
assert containingDeclaration instanceof ClassDescriptor : containingDeclaration;
|
assert containingDeclaration instanceof ClassDescriptor : containingDeclaration;
|
||||||
JetClassOrObject psiElement = (JetClassOrObject) DescriptorToSourceUtils.getSourceFromDescriptor(classDescriptor);
|
JetClassOrObject psiElement = (JetClassOrObject) DescriptorToSourceUtils.getSourceFromDescriptor(classDescriptor);
|
||||||
|
assert psiElement != null;
|
||||||
JetDelegationSpecifierList delegationSpecifierList = psiElement.getDelegationSpecifierList();
|
JetDelegationSpecifierList delegationSpecifierList = psiElement.getDelegationSpecifierList();
|
||||||
assert delegationSpecifierList != null;
|
assert delegationSpecifierList != null;
|
||||||
// trace.getErrorHandler().genericError(delegationSpecifierList.getNode(), "Type parameter " + typeParameterDescriptor.getName() + " of " + containingDeclaration.getName() + " has inconsistent values: " + conflictingTypes);
|
// trace.getErrorHandler().genericError(delegationSpecifierList.getNode(), "Type parameter " + typeParameterDescriptor.getName() + " of " + containingDeclaration.getName() + " has inconsistent values: " + conflictingTypes);
|
||||||
@@ -535,11 +539,65 @@ 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) 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.getNextSiblingIgnoringWhitespace(enumEntry);
|
||||||
|
IElementType nextType = next.getNode().getElementType();
|
||||||
|
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.getNextSiblingIgnoringWhitespace(next);
|
||||||
|
nextType = next.getNode().getElementType();
|
||||||
|
}
|
||||||
|
return nextType != JetTokens.SEMICOLON && nextType != JetTokens.RBRACE ? ";" : "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean enumEntryUsesDeprecatedOrNoDelimiter(@NotNull JetEnumEntry enumEntry) {
|
||||||
|
return !enumEntryExpectedDelimiter(enumEntry).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
private void checkEnumEntry(@NotNull JetEnumEntry enumEntry, @NotNull ClassDescriptor classDescriptor) {
|
private void checkEnumEntry(@NotNull JetEnumEntry enumEntry, @NotNull ClassDescriptor classDescriptor) {
|
||||||
DeclarationDescriptor declaration = classDescriptor.getContainingDeclaration();
|
DeclarationDescriptor declaration = classDescriptor.getContainingDeclaration();
|
||||||
assert DescriptorUtils.isEnumClass(declaration) : "Enum entry should be declared in enum class: " + classDescriptor;
|
assert DescriptorUtils.isEnumClass(declaration) : "Enum entry should be declared in enum class: " + classDescriptor;
|
||||||
ClassDescriptor enumClass = (ClassDescriptor) declaration;
|
ClassDescriptor enumClass = (ClassDescriptor) declaration;
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
List<JetDelegationSpecifier> delegationSpecifiers = enumEntry.getDelegationSpecifiers();
|
List<JetDelegationSpecifier> delegationSpecifiers = enumEntry.getDelegationSpecifiers();
|
||||||
ConstructorDescriptor constructor = enumClass.getUnsubstitutedPrimaryConstructor();
|
ConstructorDescriptor constructor = enumClass.getUnsubstitutedPrimaryConstructor();
|
||||||
if ((constructor == null || !constructor.getValueParameters().isEmpty()) && delegationSpecifiers.isEmpty()) {
|
if ((constructor == null || !constructor.getValueParameters().isEmpty()) && delegationSpecifiers.isEmpty()) {
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
enum class A {
|
enum class A {
|
||||||
ONE
|
ONE,
|
||||||
TWO
|
TWO;
|
||||||
|
|
||||||
fun invoke(i: Int) = i
|
fun invoke(i: Int) = i
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
enum class A {
|
enum class A {
|
||||||
ONE
|
ONE,
|
||||||
TWO
|
TWO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import A.ONE
|
import A.ONE
|
||||||
|
|
||||||
enum class A {
|
enum class A {
|
||||||
ONE
|
ONE,
|
||||||
TWO
|
TWO;
|
||||||
|
|
||||||
fun invoke(i: Int) = i
|
fun invoke(i: Int) = i
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import A.ONE
|
import A.ONE
|
||||||
|
|
||||||
enum class A {
|
enum class A {
|
||||||
ONE
|
ONE,
|
||||||
TWO
|
TWO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package a
|
|||||||
|
|
||||||
|
|
||||||
enum class C {
|
enum class C {
|
||||||
E1 E2 E3 {
|
E1, E2, E3 {
|
||||||
object O_O
|
object O_O
|
||||||
|
|
||||||
fun b() {
|
fun b() {
|
||||||
@@ -10,7 +10,7 @@ enum class C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class G
|
class G
|
||||||
}
|
},
|
||||||
|
|
||||||
E4 {
|
E4 {
|
||||||
fun c() {
|
fun c() {
|
||||||
@@ -22,7 +22,7 @@ enum class C {
|
|||||||
//TODO: this is a bug
|
//TODO: this is a bug
|
||||||
this.<!UNRESOLVED_REFERENCE!>A<!>()
|
this.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
class A
|
class A
|
||||||
inner class B
|
inner class B
|
||||||
|
|||||||
+2
-2
@@ -71,11 +71,11 @@ fun t1() {
|
|||||||
enum class ProtocolState {
|
enum class ProtocolState {
|
||||||
WAITING {
|
WAITING {
|
||||||
override fun signal() = ProtocolState.TALKING
|
override fun signal() = ProtocolState.TALKING
|
||||||
}
|
},
|
||||||
|
|
||||||
TALKING {
|
TALKING {
|
||||||
override fun signal() = ProtocolState.WAITING
|
override fun signal() = ProtocolState.WAITING
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun signal() : ProtocolState
|
abstract fun signal() : ProtocolState
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
package kt1185
|
package kt1185
|
||||||
|
|
||||||
enum class Direction {
|
enum class Direction {
|
||||||
NORTH
|
NORTH,
|
||||||
SOUTH
|
SOUTH,
|
||||||
WEST
|
WEST,
|
||||||
EAST
|
EAST
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,9 +16,9 @@ class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class Color(val rgb : Int) {
|
enum class Color(val rgb : Int) {
|
||||||
RED : Color(0xFF0000)
|
RED(0xFF0000),
|
||||||
GREEN : Color(0x00FF00)
|
GREEN(0x00FF00),
|
||||||
BLUE : Color(0x0000FF)
|
BLUE(0x0000FF)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun foo(d: Direction) = when(d) { //no 'else' should be requested
|
fun foo(d: Direction) = when(d) { //no 'else' should be requested
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
package kt1193
|
package kt1193
|
||||||
|
|
||||||
enum class MyEnum(val i: Int) {
|
enum class MyEnum(val i: Int) {
|
||||||
A : MyEnum(12)
|
A(12),
|
||||||
<!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>B<!> //no error
|
<!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>B<!> //no error
|
||||||
}
|
}
|
||||||
|
|
||||||
open class A(x: Int = 1)
|
open class A(x: Int = 1)
|
||||||
enum class MyOtherEnum(val i: Int) {
|
enum class MyOtherEnum(val i: Int) {
|
||||||
X : <!ENUM_ENTRY_ILLEGAL_TYPE!>A<!>(3)
|
X : <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!><!ENUM_ENTRY_ILLEGAL_TYPE!>A<!>(3)<!>,
|
||||||
Y : <!ENUM_ENTRY_ILLEGAL_TYPE!>A<!>()
|
Y : <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!><!ENUM_ENTRY_ILLEGAL_TYPE!>A<!>()<!>,
|
||||||
Z : <!ENUM_ENTRY_ILLEGAL_TYPE!>A<!>(3) {}
|
Z : <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!><!ENUM_ENTRY_ILLEGAL_TYPE!>A<!>(3)<!> {}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
enum class <!CONFLICTING_JVM_DECLARATIONS, CONFLICTING_JVM_DECLARATIONS!>A<!> {
|
enum class <!CONFLICTING_JVM_DECLARATIONS, CONFLICTING_JVM_DECLARATIONS!>A<!> {
|
||||||
A1
|
A1,
|
||||||
A2
|
A2;
|
||||||
|
|
||||||
<!CONFLICTING_JVM_DECLARATIONS!>fun valueOf(s: String): A<!> = valueOf(s)
|
<!CONFLICTING_JVM_DECLARATIONS!>fun valueOf(s: String): A<!> = valueOf(s)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ enum class E : T {
|
|||||||
ENTRY {
|
ENTRY {
|
||||||
override fun f() {
|
override fun f() {
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract override fun f()
|
abstract override fun f()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
ENTRY
|
ENTRY;
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun entry() = ENTRY
|
fun entry() = ENTRY
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
ENTRY
|
ENTRY;
|
||||||
|
|
||||||
private companion object
|
private companion object
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
FIRST
|
FIRST,
|
||||||
SECOND {
|
SECOND {
|
||||||
class A
|
class A
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
val foo: Any.() -> Unit = {}
|
val foo: Any.() -> Unit = {}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
E1
|
E1,
|
||||||
E2
|
E2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
enum class MyEnum {
|
||||||
|
A,
|
||||||
|
<!ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER!>B<!>,
|
||||||
|
|
||||||
|
val z = 42
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||||
|
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<MyEnum>
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
FIRST
|
FIRST,
|
||||||
|
|
||||||
SECOND {
|
SECOND {
|
||||||
<!COMPANION_OBJECT_NOT_ALLOWED!>companion<!> object {
|
<!COMPANION_OBJECT_NOT_ALLOWED!>companion<!> object {
|
||||||
fun foo() = 42
|
fun foo() = 42
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
fun f() = E.SECOND.<!UNRESOLVED_REFERENCE!>foo<!>()
|
fun f() = E.SECOND.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ enum class EnumClass {
|
|||||||
E1 {
|
E1 {
|
||||||
override fun foo() = 1
|
override fun foo() = 1
|
||||||
override val bar: String = "a"
|
override val bar: String = "a"
|
||||||
}
|
},
|
||||||
|
|
||||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E2<!> {
|
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E2<!> {
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun foo(): Int
|
abstract fun foo(): Int
|
||||||
abstract val bar: String
|
abstract val bar: String
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ interface T1 {
|
|||||||
enum class EnumImplementingTraitWithFun: T1 {
|
enum class EnumImplementingTraitWithFun: T1 {
|
||||||
E1 {
|
E1 {
|
||||||
override fun foo() {}
|
override fun foo() {}
|
||||||
}
|
},
|
||||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E2<!>
|
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E2<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,6 +16,6 @@ interface T2 {
|
|||||||
enum class EnumImplementingTraitWithVal: T2 {
|
enum class EnumImplementingTraitWithVal: T2 {
|
||||||
E1 {
|
E1 {
|
||||||
override val bar = 1
|
override val bar = 1
|
||||||
}
|
},
|
||||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E2<!>
|
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E2<!>
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
enum class MyEnum {
|
||||||
|
A, B, <!ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER!>C<!> D, <!ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER!>E<!> F
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||||
|
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<MyEnum>
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
enum class MyEnum {
|
||||||
|
<!ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER!>A<!>
|
||||||
|
B
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||||
|
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<MyEnum>
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
enum class MyEnum {
|
||||||
|
A,
|
||||||
|
<!ENUM_ENTRY_USES_DEPRECATED_OR_NO_DELIMITER!>B<!>
|
||||||
|
|
||||||
|
val z = 42
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||||
|
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<MyEnum>
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
enum class MyEnum(val myArg: Int) {
|
||||||
|
FIRST(1),
|
||||||
|
SECOND: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>MyEnum(2)<!>,
|
||||||
|
THIRD(3),
|
||||||
|
FOURTH(4)
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||||
|
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<MyEnum>
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
enum class MyEnum(val myArg: Int) {
|
||||||
|
FIRST(1),
|
||||||
|
SECOND: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>MyEnum(myArg = 2)<!>,
|
||||||
|
THIRD(3),
|
||||||
|
FOURTH(4)
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||||
|
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<MyEnum>
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
enum class MyEnum(val myArg: Int) {
|
||||||
|
FIRST: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>MyEnum(1)<!>,
|
||||||
|
SECOND: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>MyEnum(2)<!>,
|
||||||
|
THIRD: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>MyEnum(3)<!>,
|
||||||
|
FOURTH: <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>MyEnum(4)<!>
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
internal final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||||
|
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<MyEnum>
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
package enum
|
package enum
|
||||||
|
|
||||||
enum class HappyEnum {
|
enum class HappyEnum {
|
||||||
CASE1
|
CASE1,
|
||||||
CASE2
|
CASE2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ public enum MyJavaEnum {}
|
|||||||
|
|
||||||
// FILE: test.kt
|
// FILE: test.kt
|
||||||
<!OPEN_MODIFIER_IN_ENUM!>open<!> enum class MyEnum() {
|
<!OPEN_MODIFIER_IN_ENUM!>open<!> enum class MyEnum() {
|
||||||
A: MyEnum()
|
A()
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class MyEnum2() {}
|
enum class MyEnum2() {}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
ABC
|
ABC;
|
||||||
|
|
||||||
enum class F {
|
enum class F {
|
||||||
DEF
|
DEF
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
private enum class MethodKind {
|
private enum class MethodKind {
|
||||||
INSTANCE
|
INSTANCE,
|
||||||
STATIC
|
STATIC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
<!LOCAL_ENUM_NOT_ALLOWED!>enum class A<!> {
|
<!LOCAL_ENUM_NOT_ALLOWED!>enum class A<!> {
|
||||||
FOO
|
FOO,
|
||||||
BAR
|
BAR
|
||||||
}
|
}
|
||||||
val foo = A.FOO
|
val foo = A.FOO
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
<!ILLEGAL_MODIFIER!>public<!> <!ILLEGAL_MODIFIER!>final<!> SUBCLASS {
|
<!ILLEGAL_MODIFIER!>public<!> <!ILLEGAL_MODIFIER!>final<!> SUBCLASS {
|
||||||
fun foo() {}
|
fun foo() {}
|
||||||
}
|
},
|
||||||
|
|
||||||
<!ILLEGAL_MODIFIER!>public<!> PUBLIC
|
<!ILLEGAL_MODIFIER!>public<!> PUBLIC,
|
||||||
<!ILLEGAL_MODIFIER!>protected<!> PROTECTED
|
<!ILLEGAL_MODIFIER!>protected<!> PROTECTED,
|
||||||
<!ILLEGAL_MODIFIER!>private<!> PRIVATE
|
<!ILLEGAL_MODIFIER!>private<!> PRIVATE,
|
||||||
<!ILLEGAL_MODIFIER!>internal<!> INTERNAL
|
<!ILLEGAL_MODIFIER!>internal<!> INTERNAL,
|
||||||
|
|
||||||
<!ILLEGAL_MODIFIER!>abstract<!> ABSTRACT
|
<!ILLEGAL_MODIFIER!>abstract<!> ABSTRACT,
|
||||||
<!ILLEGAL_MODIFIER!>open<!> OPEN
|
<!ILLEGAL_MODIFIER!>open<!> OPEN,
|
||||||
<!ILLEGAL_MODIFIER!>override<!> OVERRIDE
|
<!ILLEGAL_MODIFIER!>override<!> OVERRIDE,
|
||||||
<!ILLEGAL_MODIFIER!>final<!> FINAL
|
<!ILLEGAL_MODIFIER!>final<!> FINAL,
|
||||||
|
|
||||||
<!ILLEGAL_MODIFIER!>inner<!> INNER
|
<!ILLEGAL_MODIFIER!>inner<!> INNER,
|
||||||
<!ILLEGAL_MODIFIER!>annotation<!> ANNOTATION
|
<!ILLEGAL_MODIFIER!>annotation<!> ANNOTATION,
|
||||||
<!ILLEGAL_MODIFIER!>enum<!> ENUM
|
<!ILLEGAL_MODIFIER!>enum<!> ENUM,
|
||||||
<!ILLEGAL_MODIFIER!>out<!> OUT
|
<!ILLEGAL_MODIFIER!>out<!> OUT,
|
||||||
<!ILLEGAL_MODIFIER!>in<!> IN
|
<!ILLEGAL_MODIFIER!>in<!> IN,
|
||||||
<!ILLEGAL_MODIFIER!>vararg<!> VARARG
|
<!ILLEGAL_MODIFIER!>vararg<!> VARARG,
|
||||||
<!ILLEGAL_MODIFIER!>reified<!> REIFIED
|
<!ILLEGAL_MODIFIER!>reified<!> REIFIED
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ enum class EnumWithOpenMembers {
|
|||||||
E1 {
|
E1 {
|
||||||
override fun foo() = 1
|
override fun foo() = 1
|
||||||
override val bar: String = "a"
|
override val bar: String = "a"
|
||||||
}
|
},
|
||||||
|
|
||||||
E2 {
|
E2 {
|
||||||
<!OVERRIDING_FINAL_MEMBER!>override<!> fun f() = 3
|
<!OVERRIDING_FINAL_MEMBER!>override<!> fun f() = 3
|
||||||
<!OVERRIDING_FINAL_MEMBER!>override<!> val b = 4
|
<!OVERRIDING_FINAL_MEMBER!>override<!> val b = 4
|
||||||
}
|
};
|
||||||
|
|
||||||
open fun foo() = 1
|
open fun foo() = 1
|
||||||
open val bar: String = ""
|
open val bar: String = ""
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
enum class E {
|
enum class E {
|
||||||
ENTRY
|
ENTRY,
|
||||||
ANOTHER
|
ANOTHER;
|
||||||
|
|
||||||
class Nested {
|
class Nested {
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
package bug
|
package bug
|
||||||
|
|
||||||
public enum class Foo<!TYPE_PARAMETERS_IN_ENUM!><T><!> {
|
public enum class Foo<!TYPE_PARAMETERS_IN_ENUM!><T><!> {
|
||||||
A : Foo<String>()
|
A : <!ENUM_ENTRY_USES_DEPRECATED_SUPER_CONSTRUCTOR!>Foo<String>()<!>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
ENTRY
|
ENTRY;
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun foo(): E = ENTRY
|
fun foo(): E = ENTRY
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class E {
|
enum class E {
|
||||||
E1 E2
|
E1, E2
|
||||||
}
|
}
|
||||||
|
|
||||||
object B {
|
object B {
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
A
|
A,
|
||||||
B
|
B,
|
||||||
C
|
C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
package a
|
package a
|
||||||
|
|
||||||
enum class SomeEnum {
|
enum class SomeEnum {
|
||||||
FIRST
|
FIRST,
|
||||||
SECOND
|
SECOND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
package a
|
package a
|
||||||
|
|
||||||
enum class TestEnum {
|
enum class TestEnum {
|
||||||
FIRST
|
FIRST,
|
||||||
SECOND
|
SECOND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import Kind.EXT_RETURN
|
|||||||
import Kind.GLOBAL_RETURN
|
import Kind.GLOBAL_RETURN
|
||||||
|
|
||||||
enum class Kind {
|
enum class Kind {
|
||||||
LOCAL
|
LOCAL,
|
||||||
EXT_RETURN
|
EXT_RETURN,
|
||||||
GLOBAL_RETURN
|
GLOBAL_RETURN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
E1 {
|
E1 {
|
||||||
override fun foo() = outerFun() + super.outerFun()
|
override fun foo() = outerFun() + super.outerFun()
|
||||||
}
|
},
|
||||||
E2 {
|
E2 {
|
||||||
override fun foo() = E1.foo()
|
override fun foo() = E1.foo()
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun foo(): Int
|
abstract fun foo(): Int
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class D {
|
|||||||
enum class H {
|
enum class H {
|
||||||
<!ILLEGAL_MODIFIER!>inner<!> I {
|
<!ILLEGAL_MODIFIER!>inner<!> I {
|
||||||
inner class II
|
inner class II
|
||||||
}
|
};
|
||||||
|
|
||||||
inner class J
|
inner class J
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
E1
|
E1,
|
||||||
E2 { }
|
E2 { };
|
||||||
}
|
}
|
||||||
|
|
||||||
fun foo() = E.E1
|
fun foo() = E.E1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class A {
|
class A {
|
||||||
enum class E {
|
enum class E {
|
||||||
E1
|
E1,
|
||||||
E2 { }
|
E2 { };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ class J {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<!ILLEGAL_MODIFIER!>companion<!> enum class Enum {
|
<!ILLEGAL_MODIFIER!>companion<!> enum class Enum {
|
||||||
E1
|
E1,
|
||||||
E2
|
E2;
|
||||||
|
|
||||||
companion object
|
companion object
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
FIRST
|
FIRST,
|
||||||
|
|
||||||
SECOND
|
SECOND;
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
class FIRST
|
class FIRST
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ object Foo {
|
|||||||
<!CONFLICTING_OVERLOADS!>fun En()<!> = 239
|
<!CONFLICTING_OVERLOADS!>fun En()<!> = 239
|
||||||
|
|
||||||
enum class <!CONFLICTING_OVERLOADS!>En<!> {
|
enum class <!CONFLICTING_OVERLOADS!>En<!> {
|
||||||
ENTRY
|
ENTRY,
|
||||||
|
|
||||||
SUBCLASS { }
|
SUBCLASS { };
|
||||||
|
|
||||||
fun ENTRY() = 42
|
fun ENTRY() = 42
|
||||||
|
|
||||||
|
|||||||
@@ -3,24 +3,24 @@
|
|||||||
package kt2418
|
package kt2418
|
||||||
|
|
||||||
enum class A {
|
enum class A {
|
||||||
<!REDECLARATION!>FOO<!>
|
<!REDECLARATION!>FOO<!>,
|
||||||
<!REDECLARATION!>FOO<!>
|
<!REDECLARATION!>FOO<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class B {
|
enum class B {
|
||||||
FOO
|
FOO;
|
||||||
|
|
||||||
fun FOO() {}
|
fun FOO() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class C {
|
enum class C {
|
||||||
<!REDECLARATION!>FOO<!>
|
<!REDECLARATION!>FOO<!>;
|
||||||
|
|
||||||
val <!REDECLARATION!>FOO<!> = 1
|
val <!REDECLARATION!>FOO<!> = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class D {
|
enum class D {
|
||||||
<!REDECLARATION!>FOO<!>
|
<!REDECLARATION!>FOO<!>;
|
||||||
|
|
||||||
class <!REDECLARATION!>FOO<!> {}
|
class <!REDECLARATION!>FOO<!> {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
enum class ProtocolState {
|
enum class ProtocolState {
|
||||||
WAITING {
|
WAITING {
|
||||||
override fun signal() = ProtocolState.TALKING
|
override fun signal() = ProtocolState.TALKING
|
||||||
}
|
},
|
||||||
|
|
||||||
TALKING {
|
TALKING {
|
||||||
override fun signal() = ProtocolState.WAITING
|
override fun signal() = ProtocolState.WAITING
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun signal() : ProtocolState
|
abstract fun signal() : ProtocolState
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
enum class ProtocolState {
|
enum class ProtocolState {
|
||||||
WAITING {
|
WAITING {
|
||||||
override fun signal() = ProtocolState.TALKING
|
override fun signal() = ProtocolState.TALKING
|
||||||
}
|
},
|
||||||
|
|
||||||
TALKING {
|
TALKING {
|
||||||
override fun signal() = ProtocolState.WAITING
|
override fun signal() = ProtocolState.WAITING
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun signal() : ProtocolState
|
abstract fun signal() : ProtocolState
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import DOMElementTestClasses.cls2
|
|||||||
|
|
||||||
// use case 1
|
// use case 1
|
||||||
enum class DOMElementTestClasses {
|
enum class DOMElementTestClasses {
|
||||||
cls1 cls2
|
cls1, cls2;
|
||||||
|
|
||||||
fun invoke() {}
|
fun invoke() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ object A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class B {
|
enum class B {
|
||||||
X : B() {
|
X() {
|
||||||
<!SECONDARY_CONSTRUCTOR_IN_OBJECT!>constructor()
|
<!SECONDARY_CONSTRUCTOR_IN_OBJECT!>constructor()
|
||||||
<!>}
|
<!>}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
enum class A {
|
enum class A {
|
||||||
W: A(1) X: A(1, 2) Y: A(3.0) Z: A("") E: A()
|
W(1), X(1, 2), Y(3.0), Z(""), E();
|
||||||
|
|
||||||
constructor()
|
constructor()
|
||||||
constructor(x: Int)
|
constructor(x: Int)
|
||||||
@@ -10,7 +10,7 @@ enum class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class B(x: Int) {
|
enum class B(x: Int) {
|
||||||
W: B(1) X: B(1, 2) Y: B(3.0) Z: B("")
|
W(1), X(1, 2), Y(3.0), Z("");
|
||||||
|
|
||||||
constructor(x: Int, y: Int): this(x+y)
|
constructor(x: Int, y: Int): this(x+y)
|
||||||
constructor(x: Double): this(x.toInt(), 1)
|
constructor(x: Double): this(x.toInt(), 1)
|
||||||
@@ -18,20 +18,20 @@ enum class B(x: Int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class C {
|
enum class C {
|
||||||
EMPTY: C() // may be we should avoid explicit call here
|
EMPTY(); // may be we should avoid explicit call here
|
||||||
constructor()
|
constructor()
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class D(val prop: Int) {
|
enum class D(val prop: Int) {
|
||||||
X: D(123) {
|
X(123) {
|
||||||
override fun f() = 1
|
override fun f() = 1
|
||||||
}
|
},
|
||||||
Y: D() {
|
Y() {
|
||||||
override fun f() = prop
|
override fun f() = prop
|
||||||
}
|
},
|
||||||
Z: D("abc") {
|
Z("abc") {
|
||||||
override fun f() = prop
|
override fun f() = prop
|
||||||
}
|
};
|
||||||
|
|
||||||
constructor(): this(1)
|
constructor(): this(1)
|
||||||
constructor(x: String): this(x.length())
|
constructor(x: String): this(x.length())
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
|
|
||||||
enum class E { A B }
|
enum class E { A, B }
|
||||||
|
|
||||||
fun test(e: E?) = <!NO_ELSE_IN_WHEN!>when<!> (e) {
|
fun test(e: E?) = <!NO_ELSE_IN_WHEN!>when<!> (e) {
|
||||||
E.A -> 1
|
E.A -> 1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
enum class E { A B }
|
enum class E { A, B }
|
||||||
|
|
||||||
fun foo(e: E, something: Any?): Int {
|
fun foo(e: E, something: Any?): Int {
|
||||||
if (something != null) return 0
|
if (something != null) return 0
|
||||||
|
|||||||
+4
-4
@@ -22,7 +22,7 @@ class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<!NON_TOPLEVEL_CLASS_DECLARATION!>enum class E<!> {
|
<!NON_TOPLEVEL_CLASS_DECLARATION!>enum class E<!> {
|
||||||
X Y
|
X, Y;
|
||||||
|
|
||||||
companion object {}
|
companion object {}
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ interface T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<!NON_TOPLEVEL_CLASS_DECLARATION!>enum class E<!> {
|
<!NON_TOPLEVEL_CLASS_DECLARATION!>enum class E<!> {
|
||||||
X Y
|
X, Y;
|
||||||
|
|
||||||
companion object {}
|
companion object {}
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ interface T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum class E {
|
enum class E {
|
||||||
X Y
|
X, Y;
|
||||||
|
|
||||||
<!NON_TOPLEVEL_CLASS_DECLARATION!>class B<!> {
|
<!NON_TOPLEVEL_CLASS_DECLARATION!>class B<!> {
|
||||||
<!NON_TOPLEVEL_CLASS_DECLARATION!>class C<!>
|
<!NON_TOPLEVEL_CLASS_DECLARATION!>class C<!>
|
||||||
@@ -86,7 +86,7 @@ enum class E {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<!NON_TOPLEVEL_CLASS_DECLARATION!>enum class E<!> {
|
<!NON_TOPLEVEL_CLASS_DECLARATION!>enum class E<!> {
|
||||||
X Y
|
X, Y;
|
||||||
|
|
||||||
companion object {}
|
companion object {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4176,6 +4176,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumCommaNoSemicolon.kt")
|
||||||
|
public void testEnumCommaNoSemicolon() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumCommaNoSemicolon.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("enumEntryCannotHaveClassObject.kt")
|
@TestMetadata("enumEntryCannotHaveClassObject.kt")
|
||||||
public void testEnumEntryCannotHaveClassObject() throws Exception {
|
public void testEnumEntryCannotHaveClassObject() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumEntryCannotHaveClassObject.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumEntryCannotHaveClassObject.kt");
|
||||||
@@ -4206,6 +4212,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest(fileName);
|
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")
|
@TestMetadata("enumMissingName.kt")
|
||||||
public void testEnumMissingName() throws Exception {
|
public void testEnumMissingName() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumMissingName.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumMissingName.kt");
|
||||||
@@ -4218,6 +4230,36 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest(fileName);
|
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("enumStarImport.kt")
|
@TestMetadata("enumStarImport.kt")
|
||||||
public void testEnumStarImport() throws Exception {
|
public void testEnumStarImport() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumStarImport.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/enum/enumStarImport.kt");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
enum class E {
|
enum class E {
|
||||||
ENTRY
|
ENTRY;
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun foo(): E = ENTRY
|
fun foo(): E = ENTRY
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ val <error>a</error> : Int = 1
|
|||||||
<error>fun foo()</error> {}
|
<error>fun foo()</error> {}
|
||||||
|
|
||||||
enum class EnumClass {
|
enum class EnumClass {
|
||||||
<error>FOO</error>
|
<error>FOO</error>,
|
||||||
<error>FOO</error>
|
<error>FOO</error>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// KT-3750 When without else
|
// KT-3750 When without else
|
||||||
|
|
||||||
enum class A {
|
enum class A {
|
||||||
e1
|
e1,
|
||||||
e2
|
e2
|
||||||
}
|
}
|
||||||
class B(val a: A)
|
class B(val a: A)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
enum class ProtocolState {
|
enum class ProtocolState {
|
||||||
WAITING {
|
WAITING {
|
||||||
override fun signal() = ProtocolState.TALKING
|
override fun signal() = ProtocolState.TALKING
|
||||||
}
|
},
|
||||||
|
|
||||||
TALKING {
|
TALKING {
|
||||||
override fun signal() = ProtocolState.WAITING
|
override fun signal() = ProtocolState.WAITING
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun signal() : ProtocolState
|
abstract fun signal() : ProtocolState
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
enum class ProtocolState {
|
enum class ProtocolState {
|
||||||
WAITING {
|
WAITING {
|
||||||
override fun signal() = ProtocolState.TALKING
|
override fun signal() = ProtocolState.TALKING
|
||||||
}
|
},
|
||||||
|
|
||||||
TALKING {
|
TALKING {
|
||||||
override fun signal() = ProtocolState.WAITING
|
override fun signal() = ProtocolState.WAITING
|
||||||
}
|
};
|
||||||
|
|
||||||
abstract fun signal() : ProtocolState
|
abstract fun signal() : ProtocolState
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">enum</info> class <info textAttributesKey="KOTLIN_CLASS">Test</info> {
|
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">enum</info> class <info textAttributesKey="KOTLIN_CLASS">Test</info> {
|
||||||
<info textAttributesKey="KOTLIN_CLASS">FIRST</info>
|
<info textAttributesKey="KOTLIN_CLASS">FIRST</info>,
|
||||||
<info textAttributesKey="KOTLIN_CLASS">SECOND</info>
|
<info textAttributesKey="KOTLIN_CLASS">SECOND</info>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user