FIR: Do not add alias for variables with explicit type

This commit is contained in:
Denis.Zharkov
2021-10-20 10:06:46 +03:00
committed by TeamCityServer
parent 5317cf3af1
commit a0a57581ec
29 changed files with 562 additions and 67 deletions
@@ -10,5 +10,5 @@ fun main() {
val c : ListOfLists<*> = b
val d : ArrayList<ArrayList<*>> = <!INITIALIZER_TYPE_MISMATCH!>c.x<!>
c.x checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><ArrayList<out ArrayList<*>>>() }
c.x checkType { _<ArrayList<out ArrayList<*>>>() }
}
@@ -1,17 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
class A<out T, in E> {
fun foo(x: @UnsafeVariance T) {}
fun foo(x: @UnsafeVariance T, y: List<@UnsafeVariance T>): @UnsafeVariance E = null!!
fun bar(): List<@UnsafeVariance E> = null!!
}
fun foo(x: A<String, Any?>, cs: CharSequence, ls: List<CharSequence>) {
val y: A<CharSequence, String> = x
y.foo(<!ARGUMENT_TYPE_MISMATCH!>cs<!>)
val s: String = <!INITIALIZER_TYPE_MISMATCH!>y.foo(<!ARGUMENT_TYPE_MISMATCH!>cs<!>, <!ARGUMENT_TYPE_MISMATCH!>ls<!>)<!>
val ls2: List<String> = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>y.bar()<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
class A<out T, in E> {