Files
kotlin-fork/compiler/testData/codegen/box/builderInference/issues/kt49263.kt
T
2023-12-05 18:15:50 +00:00

24 lines
416 B
Kotlin
Vendored

// ISSUE: KT-49263
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: ANY
// REASON: red code (see corresponding diagnostic test)
fun box(): String {
buildPostponedTypeVariable {
consumeTargetType(this)
}
return "OK"
}
class TargetType
fun consumeTargetType(value: TargetType) {}
fun <PTV> buildPostponedTypeVariable(block: PTV.() -> Unit): PTV {
return (TargetType() as PTV).apply(block)
}