Files
kotlin-fork/compiler/testData/codegen/box/builderInference/issues/kt54400a.kt
T
2024-01-10 14:56:30 +00:00

27 lines
513 B
Kotlin
Vendored

// ISSUE: KT-54400
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND_K1: ANY
// REASON: red code (see corresponding diagnostic test)
fun box(): String {
build {
typeVariableMutableProperty = ""
}
return "OK"
}
class Buildee<TV> {
var typeVariableMutableProperty: TV
get() = storage
set(value) { storage = value }
private var storage: TV = "" as TV
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}