05ca001310
It would be more consistently to prohibit the behavior from the unmuted test (see KT-52428), but it was decided to postpone the breaking change. Unfortunately, it didn't work to make a test where for computing star projections we would need to substitute other type parameters because effectively, it's not allowed to have SAM conversion when star projections/wildcard is based on a type parameter which bounds use other type parameters. ^KT-53552 In progress
10 lines
274 B
Kotlin
Vendored
10 lines
274 B
Kotlin
Vendored
fun f(x: Any): String {
|
|
when {
|
|
x is A<*> -> return x /*as A<*> */.call(block = local fun <anonymous>(y: Any?): @FlexibleNullability String? {
|
|
return "OK"
|
|
}
|
|
/*-> @FlexibleNullability I<out @FlexibleNullability Any?>? */) /*!! String */
|
|
}
|
|
return "Fail"
|
|
}
|