Kapt+JVM_IR: add regression test for KT-61212
#KT-61212
diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.ir.txt
new file mode 100644
index 0000000..9b097be
--- /dev/null
+++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.ir.txt
@@ -0,0 +1,57 @@
+/**
+ * public final enum class E : kotlin/Enum<E> {
+ *
+ * // signature: <init>(Ljava/lang/String;ILI;)V
+ * private constructor(i: I)
+ *
+ * // field: i:LI;
+ * // getter: getI()LI;
+ * public final val i: I
+ * public final get
+ *
+ * E1,
+ *
+ * E2,
+ *
+ * E3,
+ *
+ * // module name: main
+ *
+ * // has Enum.entries
+ * }
+ */
+@kotlin.Metadata()
+@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
+public enum E {
+ /*public static final*/ E1 /* = new E() */,
+ /*public static final*/ E2 /* = new E() */,
+ /*public static final*/ E3 /* = new E() */;
+ @org.jetbrains.annotations.NotNull()
+ private final I i = null;
+
+ E(I i) {
+ }
+
+ @org.jetbrains.annotations.NotNull()
+ public final I getI() {
+ return null;
+ }
+
+ @org.jetbrains.annotations.NotNull()
+ public static kotlin.enums.EnumEntries<E> getEntries() {
+ return null;
+ }
+}
+
+////////////////////
+
+
+/**
+ * public abstract interface I : kotlin/Any {
+ *
+ * // module name: main
+ * }
+ */
+@kotlin.Metadata()
+public abstract interface I {
+}
diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.kt b/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.kt
new file mode 100644
index 0000000..20f752c
--- /dev/null
+++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.kt
@@ -0,0 +1,10 @@
+// CORRECT_ERROR_TYPES
+
+interface I
+
+@Suppress("UNRESOLVED_REFERENCE")
+enum class E(val i: I) {
+ E1(Unresolved1),
+ E2(Unresolved2),
+ E3(Unresolved3),
+}
diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.txt
new file mode 100644
index 0000000..0ca9b10
--- /dev/null
+++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.txt
@@ -0,0 +1,52 @@
+/**
+ * public final enum class E : kotlin/Enum<E> {
+ *
+ * // signature: <init>(Ljava/lang/String;ILI;)V
+ * private constructor(i: I)
+ *
+ * // field: i:LI;
+ * // getter: getI()LI;
+ * public final val i: I
+ * public final get
+ *
+ * E1,
+ *
+ * E2,
+ *
+ * E3,
+ *
+ * // module name: main
+ *
+ * // has Enum.entries
+ * }
+ */
+@kotlin.Metadata()
+@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
+public enum E {
+ /*public static final*/ E1 /* = new E() */,
+ /*public static final*/ E2 /* = new E() */,
+ /*public static final*/ E3 /* = new E() */;
+ @org.jetbrains.annotations.NotNull()
+ private final I i = null;
+
+ E(I i) {
+ }
+
+ @org.jetbrains.annotations.NotNull()
+ public final I getI() {
+ return null;
+ }
+}
+
+////////////////////
+
+
+/**
+ * public abstract interface I : kotlin/Any {
+ *
+ * // module name: main
+ * }
+ */
+@kotlin.Metadata()
+public abstract interface I {
+}
diff --git a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java
index f78fbdf..6591c50 100644
--- a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java
+++ b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java
@@ -194,6 +194,12 @@
}
@Test
+ @TestMetadata("enumConstructorCallWithErrorType.kt")
+ public void testEnumConstructorCallWithErrorType() throws Exception {
+ runTest("plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.kt");
+ }
+
+ @Test
@TestMetadata("enumImports.kt")
public void testEnumImports() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/enumImports.kt");
diff --git a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java
index 9753621..f06a6a4 100644
--- a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java
+++ b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java
@@ -194,6 +194,12 @@
}
@Test
+ @TestMetadata("enumConstructorCallWithErrorType.kt")
+ public void testEnumConstructorCallWithErrorType() throws Exception {
+ runTest("plugins/kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.kt");
+ }
+
+ @Test
@TestMetadata("enumImports.kt")
public void testEnumImports() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/enumImports.kt");
diff --git a/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java b/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java
index 0d605a8..83a3057 100644
--- a/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java
+++ b/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java
@@ -194,6 +194,12 @@
}
@Test
+ @TestMetadata("enumConstructorCallWithErrorType.kt")
+ public void testEnumConstructorCallWithErrorType() throws Exception {
+ runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/enumConstructorCallWithErrorType.kt");
+ }
+
+ @Test
@TestMetadata("enumImports.kt")
public void testEnumImports() throws Exception {
runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/enumImports.kt");