[FIR] Improve approximation of captured types
- Handle flexible types in recursion check - Handle intersected supertypes separately - Make check when not to approximate captured types in type argument position more fine-grained. Only apply it to case when the captured type is replaced by a star projection. All other cases are handled by recursive calls to approximateCapturedType #KT-65377 Fixed
This commit is contained in:
committed by
Space Team
parent
831ef0f909
commit
b90598823e
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// FIR_IDENTICAL
|
||||
// DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
interface A<V>
|
||||
|
||||
fun interface F<O> {
|
||||
fun apply(): A<O>
|
||||
}
|
||||
|
||||
object C {
|
||||
fun <V> createA(): A<V> = TODO()
|
||||
}
|
||||
|
||||
class B<V> {
|
||||
fun bar(function: F<out V>): B<V> = TODO()
|
||||
|
||||
companion object {
|
||||
fun <X> from(a: A<X>): B<X> = TODO()
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(a: A<*>) {
|
||||
B.from(a).bar { C.createA() }
|
||||
}
|
||||
Reference in New Issue
Block a user