[FIR] Make captureFromTypeParameterUpperBoundIfNeeded smarter
Before this change `ARGUMENT_TYPE_MISMATCH` would complain that `Y` "is not a subtype of" `Inv<Y>`, because the function would only check immediate bounds of the type parameter `Y`. `chosenSupertype` would be `X`, not `Inv<out kotlin/String>`. ^KT-60056
This commit is contained in:
committed by
Space Team
parent
5e1e8e8f61
commit
69fba8d33b
-11
@@ -1,11 +0,0 @@
|
||||
interface Inv<T>
|
||||
|
||||
fun <Y: X, X : Inv<out String>> foo(x: X, y: Y) {
|
||||
val rX = bar(x)
|
||||
rX.length
|
||||
|
||||
val rY = bar(<!ARGUMENT_TYPE_MISMATCH!>y<!>)
|
||||
rY.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
}
|
||||
|
||||
fun <Y> bar(l: Inv<Y>): Y = TODO()
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface Inv<T>
|
||||
|
||||
fun <Y: X, X : Inv<out String>> foo(x: X, y: Y) {
|
||||
|
||||
Reference in New Issue
Block a user