Files
kotlin-fork/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.kt.txt
Kirill Rakhman 251827c9aa [FIR] Don't approximate captured types
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
2024-01-17 08:20:05 +00:00

24 lines
887 B
Kotlin
Vendored

fun test() {
var a: SomeJavaClass<out String> = SomeJavaClass<String>()
a.someFunction(hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit
}
/*-> Hello<out @FlexibleNullability String?> */)
a.plus(hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit
}
/*-> Hello<out @FlexibleNullability String?> */) /*~> Unit */
a.get(hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit
}
/*-> Hello<out @FlexibleNullability String?> */)
a = a.plus(hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit
}
/*-> Hello<out @FlexibleNullability String?> */)
a /*as SomeJavaClass<out @FlexibleNullability String?> */.set(i = 0, hello = local fun <anonymous>(it: @FlexibleNullability String?) {
return Unit
}
/*-> Hello<out @FlexibleNullability String?> */)
}