Introduce FirInitializerTypeMismatchChecker

This commit is contained in:
vldf
2021-03-01 19:29:59 +03:00
committed by Mikhail Glukhikh
parent 7ed35e5c2b
commit 24f1f1221e
114 changed files with 647 additions and 285 deletions
@@ -9,7 +9,7 @@ fun main() {
val a : ArrayList<ArrayList<String>> = ArrayList()
val b : ListOfLists<String> = ListOfLists(a)
val c : ListOfLists<*> = b
val d : ArrayList<ArrayList<*>> = c.x
val d : ArrayList<ArrayList<*>> = <!INITIALIZER_TYPE_MISMATCH!>c.x<!>
c.x checkType { <!INAPPLICABLE_CANDIDATE!>_<!><ArrayList<out ArrayList<*>>>() }
}
@@ -13,7 +13,7 @@ class A<E> {
fun test(a: A<out CharSequence>, z: Out<CharSequence>) {
a.foo {
val x: String = 1 // Should be no TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS
val x: String = <!INITIALIZER_TYPE_MISMATCH!>1<!> // Should be no TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS
""
}
a.bar { Out<CharSequence>() }