251827c9aa
This fixes some type argument mismatch errors caused by a captured type being approximated and then captured again. Some places need to be adapted to work with captured types that previously only worked with approximated types. #KT-62959 Fixed
25 lines
449 B
Kotlin
Vendored
25 lines
449 B
Kotlin
Vendored
// ISSUE: KT-52838
|
|
// JVM_ABI_K1_K2_DIFF: KT-64738
|
|
|
|
fun box(): String {
|
|
build {
|
|
this as DerivedBuildee<*>
|
|
getTypeVariable()
|
|
}
|
|
return "OK"
|
|
}
|
|
|
|
|
|
|
|
|
|
open class Buildee<TV> {
|
|
fun getTypeVariable(): TV = storage
|
|
private var storage: TV = Any() as TV
|
|
}
|
|
|
|
class DerivedBuildee<TA>: Buildee<TA>()
|
|
|
|
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
|
|
return DerivedBuildee<PTV>().apply(instructions)
|
|
}
|