[FIR] KT-58145: Ensure the compiler fails

It fails with: "Module data is not
registered in Libraries session"
during `FirFakeOverrideGenerator.createCopyForFirProperty()`
for `callerFrame`.
This commit is contained in:
Nikolay Lunyak
2023-04-28 15:09:53 +03:00
committed by Space Team
parent efbcfb4994
commit ef28e031dc
7 changed files with 66 additions and 0 deletions
@@ -73,4 +73,16 @@ class CustomK2Tests : KGPBaseTest() {
}
}
}
@Disabled("disable until kotlin/native dependency is updated to include KT-58145")
@GradleTest
@DisplayName("Compiling shared native source with FirFakeOverrideGenerator referencing a common entity. KT-58145")
fun kt581450MppNativeSharedCrash(gradleVersion: GradleVersion) {
with(project("kt-581450-mpp-native-shared-crash", gradleVersion, buildOptions = defaultBuildOptions.copy(languageVersion = "2.0"))) {
val taskToExecute = ":compileNativeMainKotlinMetadata"
build(taskToExecute) {
assertTasksExecuted(taskToExecute)
}
}
}
}
@@ -0,0 +1,41 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
group = "test"
version = "1.0"
plugins {
kotlin("multiplatform")
}
repositories {
mavenLocal()
mavenCentral()
}
kotlin {
jvm()
linuxX64()
linuxArm64()
sourceSets {
val commonMain by getting
val jvmMain by getting {
dependsOn(commonMain)
}
val nativeMain by creating {
dependsOn(commonMain)
}
val linuxX64Main by getting {
dependsOn(nativeMain)
}
val linuxArm64Main by getting {
dependsOn(nativeMain)
}
}
}
tasks.withType<KotlinCompilationTask<*>>().configureEach {
compilerOptions {
freeCompilerArgs.add("-Xrender-internal-diagnostic-names")
}
}
@@ -0,0 +1,5 @@
open class ScopeCoroutine<T> {
val callerFrame: Any? = null
}
expect class UndispatchedCoroutine<T>(): ScopeCoroutine<T>
@@ -0,0 +1 @@
actual class UndispatchedCoroutine<T>: ScopeCoroutine<T>()