FIR: Correct capturing for type-alias bases arguments

NB: The test data change at testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.fir.kt
is correct: see the relevant non-fir test, the call shouldn't be applicable

^KT-39008 Fixed
This commit is contained in:
Denis Zharkov
2020-06-10 13:20:25 +03:00
parent bea37569e6
commit 293f78efe8
6 changed files with 41 additions and 2 deletions
@@ -0,0 +1,9 @@
class Inv<E>
typealias MyAlias = Inv<out CharSequence>
fun foo(p: MyAlias) {
bar(p).length
}
fun <T : Any> bar(x: Inv<T>): T = TODO()
@@ -0,0 +1,14 @@
FILE: typeAliasWithNotNullBound.kt
public final class Inv<E> : R|kotlin/Any| {
public constructor<E>(): R|Inv<E>| {
super<R|kotlin/Any|>()
}
}
public final typealias MyAlias = R|Inv<out kotlin/CharSequence>|
public final fun foo(p: R|MyAlias|): R|kotlin/Unit| {
R|/bar|<R|CapturedType(out kotlin/CharSequence)|>(R|<local>/p|).R|kotlin/CharSequence.length|
}
public final fun <T : R|kotlin/Any|> bar(x: R|Inv<T>|): R|T| {
^bar R|kotlin/TODO|()
}