[tests] Add test data for KT-55057

This commit is contained in:
Stanislav Ruban
2023-12-02 15:26:47 +01:00
committed by Space Team
parent bb054f75b5
commit 6532eb4c60
3 changed files with 108 additions and 0 deletions
@@ -0,0 +1,24 @@
// ISSUE: KT-55252
// IGNORE_BACKEND_K1: NATIVE
// REASON: compile-time failure (java.lang.NullPointerException @ org.jetbrains.kotlin.library.metadata.KlibModuleOriginKt.getKlibModuleOrigin)
fun box(): String {
build {
setTypeVariableProducerFunction {}
}
return "OK"
}
class Buildee<TV> {
var typeVariableProducer: () -> TV = { storage }
fun setTypeVariableProducerFunction(producer: () -> TV) { typeVariableProducer = producer }
private var storage: TV = Unit as TV
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}