diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kapt4IT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kapt4IT.kt index 3b507c6801c..08e1afb65ee 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kapt4IT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kapt4IT.kt @@ -6,7 +6,7 @@ package org.jetbrains.kotlin.gradle import org.gradle.util.GradleVersion -import org.jetbrains.kotlin.gradle.testbase.TestProject +import org.jetbrains.kotlin.gradle.testbase.* import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.DisplayName import kotlin.io.path.appendText @@ -39,6 +39,18 @@ class Kapt4IT : Kapt3IT() { @Disabled("Doesn't make sense in Kapt 4") override fun testRepeatableAnnotationsWithOldJvmBackend(gradleVersion: GradleVersion) {} + + @DisplayName("KT-61879: K2 KAPT works with proguarded compiler jars and enum class") + @GradleTest + fun testEnumClass(gradleVersion: GradleVersion) { + project("simple".withPrefix, gradleVersion) { + javaSourcesDir().resolve("test.kt").appendText("\nenum class TestEnum") + build("build") { + assertKaptSuccessful() + assertFileExists(kotlinClassesDir().resolve("example/TestEnum.class")) + } + } + } } @DisplayName("Kapt 4 with classloaders cache") diff --git a/prepare/compiler/compiler.pro b/prepare/compiler/compiler.pro index 7ab50fbcc8a..4ad8dc3c3f7 100644 --- a/prepare/compiler/compiler.pro +++ b/prepare/compiler/compiler.pro @@ -319,3 +319,6 @@ kotlinx.collections.immutable.PersistentMap toPersistentHashMap(java.util.Map); kotlinx.collections.immutable.PersistentSet persistentHashSetOf(java.lang.Object[]); } +-keepclassmembers class com.intellij.lang.jvm.JvmParameter { + com.intellij.lang.jvm.types.JvmType getType(); +} \ No newline at end of file