Fix enum entry reference from enum entry initialization context
Enum entries are "special" kind of singletons that should be referenced as a captured 'this' instance inside during entry initialization, because corresponding static fields in enum class are not initialized yet. #KT-7257 Fixed
This commit is contained in:
@@ -52,7 +52,6 @@ import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.codegen.when.SwitchCodegen;
|
||||
import org.jetbrains.kotlin.codegen.when.SwitchCodegenProvider;
|
||||
import org.jetbrains.kotlin.config.ApiVersion;
|
||||
import org.jetbrains.kotlin.config.LanguageFeature;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor;
|
||||
@@ -1741,7 +1740,12 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
return StackValue.singleton(classDescriptor, typeMapper);
|
||||
}
|
||||
if (isEnumEntry(classDescriptor)) {
|
||||
return StackValue.enumEntry(classDescriptor, typeMapper);
|
||||
if (isInsideEnumEntry(classDescriptor)) {
|
||||
return generateThisOrOuterFromContext(classDescriptor, false, false);
|
||||
}
|
||||
else {
|
||||
return StackValue.enumEntry(classDescriptor, typeMapper);
|
||||
}
|
||||
}
|
||||
ClassDescriptor companionObjectDescriptor = classDescriptor.getCompanionObjectDescriptor();
|
||||
if (companionObjectDescriptor != null) {
|
||||
@@ -2534,21 +2538,23 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
return generateThisOrOuter(calleeContainingClass, isSuper, false);
|
||||
}
|
||||
|
||||
private boolean isInInnerClassConstructorContext(@NotNull ClassDescriptor calleeContainingClass) {
|
||||
if (!(context instanceof ConstructorContext)) return false;
|
||||
private boolean isInsideEnumEntry(@NotNull ClassDescriptor enumEntryDescriptor) {
|
||||
assert DescriptorUtils.isEnumEntry(enumEntryDescriptor) :
|
||||
"Enum entry reference expected: " + enumEntryDescriptor;
|
||||
|
||||
CallableMemberDescriptor contextDescriptor = context.getContextDescriptor();
|
||||
assert contextDescriptor instanceof ConstructorDescriptor :
|
||||
"Constructor descriptor expected: " + contextDescriptor;
|
||||
ConstructorDescriptor constructorDescriptor = (ConstructorDescriptor) contextDescriptor;
|
||||
DeclarationDescriptor descriptor = context.getContextDescriptor();
|
||||
while (descriptor != null) {
|
||||
if (descriptor == enumEntryDescriptor) return true;
|
||||
|
||||
ClassDescriptor classDescriptor = constructorDescriptor.getConstructedClass();
|
||||
if (!classDescriptor.isInner()) return false;
|
||||
if (descriptor instanceof ClassDescriptor &&
|
||||
!(((ClassDescriptor) descriptor).isInner() || DescriptorUtils.isAnonymousObject(descriptor))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while (classDescriptor != null && classDescriptor.isInner()) {
|
||||
classDescriptor = DescriptorUtils.getContainingClass(classDescriptor);
|
||||
descriptor = descriptor.getContainingDeclaration();
|
||||
}
|
||||
return classDescriptor == calleeContainingClass;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -2560,7 +2566,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
return StackValue.local(0, typeMapper.mapType(calleeContainingClass));
|
||||
}
|
||||
else if (isEnumEntry(calleeContainingClass)) {
|
||||
if (!isInInnerClassConstructorContext(calleeContainingClass)) {
|
||||
if (!isInsideEnumEntry(calleeContainingClass)) {
|
||||
return StackValue.enumEntry(calleeContainingClass, typeMapper);
|
||||
}
|
||||
// else fall-through
|
||||
@@ -2570,6 +2576,10 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
}
|
||||
}
|
||||
|
||||
return generateThisOrOuterFromContext(calleeContainingClass, isSuper, forceOuter);
|
||||
}
|
||||
|
||||
private StackValue generateThisOrOuterFromContext(@NotNull ClassDescriptor calleeContainingClass, boolean isSuper, boolean forceOuter) {
|
||||
CodegenContext cur = context;
|
||||
Type type = asmType(calleeContainingClass.getDefaultType());
|
||||
StackValue result = StackValue.local(0, type);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
|
||||
enum class A {
|
||||
X {
|
||||
val x = "OK"
|
||||
|
||||
inner class Inner {
|
||||
inner class Inner2 {
|
||||
inner class Inner3 {
|
||||
val y = x
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val z = Inner().Inner2().Inner3()
|
||||
|
||||
override val test: String
|
||||
get() = z.y
|
||||
};
|
||||
|
||||
abstract val test: String
|
||||
}
|
||||
|
||||
fun box() = A.X.test
|
||||
@@ -0,0 +1,23 @@
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
|
||||
enum class A {
|
||||
X {
|
||||
val k = "K"
|
||||
|
||||
val anonObject = object {
|
||||
inner class Inner {
|
||||
val x = "O" + k
|
||||
}
|
||||
|
||||
val innerX = Inner().x
|
||||
|
||||
override fun toString() = innerX
|
||||
}
|
||||
|
||||
override val test = anonObject.toString()
|
||||
};
|
||||
|
||||
abstract val test: String
|
||||
}
|
||||
|
||||
fun box() = A.X.test
|
||||
@@ -0,0 +1,19 @@
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
|
||||
enum class A {
|
||||
X {
|
||||
val x = "OK"
|
||||
|
||||
inner class Inner {
|
||||
fun foo() = x
|
||||
}
|
||||
|
||||
val z = Inner()
|
||||
|
||||
override val test = z.foo()
|
||||
};
|
||||
|
||||
abstract val test: String
|
||||
}
|
||||
|
||||
fun box() = A.X.test
|
||||
@@ -0,0 +1,19 @@
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
|
||||
enum class A {
|
||||
X {
|
||||
val x = "OK"
|
||||
|
||||
inner class Inner {
|
||||
fun foo() = this@X.x
|
||||
}
|
||||
|
||||
val z = Inner()
|
||||
|
||||
override val test = z.foo()
|
||||
};
|
||||
|
||||
abstract val test: String
|
||||
}
|
||||
|
||||
fun box() = A.X.test
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
enum class X {
|
||||
B {
|
||||
val value2 = "K"
|
||||
override val value = "O".let { it + value2 }
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
@@ -0,0 +1,17 @@
|
||||
enum class X {
|
||||
B {
|
||||
val value2 = "K"
|
||||
|
||||
val anonObject = object {
|
||||
val value3 = "O" + value2
|
||||
|
||||
override fun toString(): String = value3
|
||||
}
|
||||
|
||||
override val value = anonObject.toString()
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
@@ -0,0 +1,16 @@
|
||||
enum class X {
|
||||
B {
|
||||
val value2 = "K"
|
||||
|
||||
val anonObject = object {
|
||||
override fun toString(): String =
|
||||
"O" + value2
|
||||
}
|
||||
|
||||
override val value = anonObject.toString()
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
@@ -0,0 +1,21 @@
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
|
||||
enum class X {
|
||||
B {
|
||||
val k = "K"
|
||||
|
||||
inner class Inner {
|
||||
fun foo() = "O" + k
|
||||
}
|
||||
|
||||
val inner = Inner()
|
||||
|
||||
val bmr = inner::foo
|
||||
|
||||
override val value = bmr.invoke()
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
@@ -0,0 +1,18 @@
|
||||
enum class X {
|
||||
B {
|
||||
|
||||
override val value = "OK"
|
||||
|
||||
val bmr = B::value.get()
|
||||
|
||||
override fun foo(): String {
|
||||
return bmr
|
||||
}
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
|
||||
abstract fun foo(): String
|
||||
}
|
||||
|
||||
fun box() = X.B.foo()
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
enum class X {
|
||||
B {
|
||||
override val value = "OK"
|
||||
|
||||
override val test = ::value.get()
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
|
||||
abstract val test: String
|
||||
}
|
||||
|
||||
fun box() = X.B.test
|
||||
@@ -0,0 +1,11 @@
|
||||
enum class X {
|
||||
B {
|
||||
override val value2 = "K"
|
||||
override val value = "O" + B.value2
|
||||
};
|
||||
|
||||
abstract val value2: String
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
@@ -0,0 +1,11 @@
|
||||
enum class X {
|
||||
B {
|
||||
override val value2 = "K"
|
||||
override val value = "O" + X.B.value2
|
||||
};
|
||||
|
||||
abstract val value2: String
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
@@ -0,0 +1,17 @@
|
||||
enum class X {
|
||||
B {
|
||||
val value2 = "K"
|
||||
|
||||
val value3: String
|
||||
init {
|
||||
fun foo() = value2
|
||||
value3 = "O" + foo()
|
||||
}
|
||||
|
||||
override val value = value3
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
@@ -0,0 +1,13 @@
|
||||
fun <T, R> T.letNoInline(fn: (T) -> R) =
|
||||
fn(this)
|
||||
|
||||
enum class X {
|
||||
B {
|
||||
val value2 = "K"
|
||||
override val value = "O".letNoInline { it + value2 }
|
||||
};
|
||||
|
||||
abstract val value: String
|
||||
}
|
||||
|
||||
fun box() = X.B.value
|
||||
+84
@@ -7757,6 +7757,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass2.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("emptyConstructor.kt")
|
||||
public void testEmptyConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/emptyConstructor.kt");
|
||||
@@ -7817,6 +7829,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass2.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerWithExistingClassObject.kt")
|
||||
public void testInnerWithExistingClassObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerWithExistingClassObject.kt");
|
||||
@@ -7835,6 +7859,66 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257.kt")
|
||||
public void testKt7257() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectInit.kt")
|
||||
public void testKt7257_anonObjectInit() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectInit.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectMethod.kt")
|
||||
public void testKt7257_anonObjectMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference1.kt")
|
||||
public void testKt7257_boundReference1() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference2.kt")
|
||||
public void testKt7257_boundReference2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReferenceWithImplicitReceiver.kt")
|
||||
public void testKt7257_boundReferenceWithImplicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_explicitReceiver.kt")
|
||||
public void testKt7257_explicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_fullyQualifiedReceiver.kt")
|
||||
public void testKt7257_fullyQualifiedReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_namedLocalFun.kt")
|
||||
public void testKt7257_namedLocalFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_notInline.kt")
|
||||
public void testKt7257_notInline() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_notInline.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt9711.kt")
|
||||
public void testKt9711() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt9711.kt");
|
||||
|
||||
@@ -7757,6 +7757,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass2.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("emptyConstructor.kt")
|
||||
public void testEmptyConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/emptyConstructor.kt");
|
||||
@@ -7817,6 +7829,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass2.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerWithExistingClassObject.kt")
|
||||
public void testInnerWithExistingClassObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerWithExistingClassObject.kt");
|
||||
@@ -7835,6 +7859,66 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257.kt")
|
||||
public void testKt7257() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectInit.kt")
|
||||
public void testKt7257_anonObjectInit() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectInit.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectMethod.kt")
|
||||
public void testKt7257_anonObjectMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference1.kt")
|
||||
public void testKt7257_boundReference1() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference2.kt")
|
||||
public void testKt7257_boundReference2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReferenceWithImplicitReceiver.kt")
|
||||
public void testKt7257_boundReferenceWithImplicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_explicitReceiver.kt")
|
||||
public void testKt7257_explicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_fullyQualifiedReceiver.kt")
|
||||
public void testKt7257_fullyQualifiedReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_namedLocalFun.kt")
|
||||
public void testKt7257_namedLocalFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_notInline.kt")
|
||||
public void testKt7257_notInline() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_notInline.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt9711.kt")
|
||||
public void testKt9711() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt9711.kt");
|
||||
|
||||
@@ -7757,6 +7757,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass2.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("emptyConstructor.kt")
|
||||
public void testEmptyConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/emptyConstructor.kt");
|
||||
@@ -7817,6 +7829,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass2.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerWithExistingClassObject.kt")
|
||||
public void testInnerWithExistingClassObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerWithExistingClassObject.kt");
|
||||
@@ -7835,6 +7859,66 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257.kt")
|
||||
public void testKt7257() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectInit.kt")
|
||||
public void testKt7257_anonObjectInit() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectInit.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectMethod.kt")
|
||||
public void testKt7257_anonObjectMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference1.kt")
|
||||
public void testKt7257_boundReference1() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference2.kt")
|
||||
public void testKt7257_boundReference2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReferenceWithImplicitReceiver.kt")
|
||||
public void testKt7257_boundReferenceWithImplicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_explicitReceiver.kt")
|
||||
public void testKt7257_explicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_fullyQualifiedReceiver.kt")
|
||||
public void testKt7257_fullyQualifiedReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_namedLocalFun.kt")
|
||||
public void testKt7257_namedLocalFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_notInline.kt")
|
||||
public void testKt7257_notInline() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_notInline.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt9711.kt")
|
||||
public void testKt9711() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt9711.kt");
|
||||
|
||||
+90
@@ -8531,6 +8531,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass2.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("emptyConstructor.kt")
|
||||
public void testEmptyConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/emptyConstructor.kt");
|
||||
@@ -8591,6 +8603,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerClassMethodInEnumEntryClass2.kt")
|
||||
public void testInnerClassMethodInEnumEntryClass2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("innerWithExistingClassObject.kt")
|
||||
public void testInnerWithExistingClassObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/innerWithExistingClassObject.kt");
|
||||
@@ -8609,6 +8633,72 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257.kt")
|
||||
public void testKt7257() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectInit.kt")
|
||||
public void testKt7257_anonObjectInit() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectInit.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_anonObjectMethod.kt")
|
||||
public void testKt7257_anonObjectMethod() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_anonObjectMethod.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference1.kt")
|
||||
public void testKt7257_boundReference1() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReference2.kt")
|
||||
public void testKt7257_boundReference2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReference2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_boundReferenceWithImplicitReceiver.kt")
|
||||
public void testKt7257_boundReferenceWithImplicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt");
|
||||
try {
|
||||
doTest(fileName);
|
||||
}
|
||||
catch (Throwable ignore) {
|
||||
return;
|
||||
}
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_explicitReceiver.kt")
|
||||
public void testKt7257_explicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_fullyQualifiedReceiver.kt")
|
||||
public void testKt7257_fullyQualifiedReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_namedLocalFun.kt")
|
||||
public void testKt7257_namedLocalFun() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt7257_notInline.kt")
|
||||
public void testKt7257_notInline() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt7257_notInline.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt9711.kt")
|
||||
public void testKt9711() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/kt9711.kt");
|
||||
|
||||
Reference in New Issue
Block a user