[FE 1.0] Fix some diagnostic tests

This commit is contained in:
Victor Petukhov
2021-07-21 17:20:00 +03:00
committed by Mikhael Bogdanov
parent 7250aed3b5
commit 95492f7370
17 changed files with 92 additions and 98 deletions
+4 -4
View File
@@ -27,15 +27,15 @@ fun foo(l: A<String>?) {
foo(l?.bar()) checkType { _<String?>() }
foo(l?.gav()) checkType { _<String?>() }
if (l != null) {
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>bar()) checkType { _<String>() }
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>gav()) checkType { _<String>() }
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>bar()) checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>gav()) checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
}
}
fun fooNotNull(l: A<String>) {
// No errors should be here
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>bar()) checkType { _<String>() }
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>gav()) checkType { _<String>() }
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>bar()) checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
foo(l<!UNNECESSARY_SAFE_CALL!>?.<!>gav()) checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
}
fun bar() {
@@ -20,7 +20,7 @@ fun foo2(a: A<out CharSequence>, b: A<in CharSequence>) {
a.foo2(Inv())
a.foo2(<!TYPE_MISMATCH!>Inv<CharSequence>()<!>)
a.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH!>Inv()<!>)
a.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>Inv()<!>)
a.foo3(In())
a.foo3(In<CharSequence>())
@@ -32,7 +32,7 @@ fun foo2(a: A<out CharSequence>, b: A<in CharSequence>) {
b.foo2(Inv())
b.foo2(<!TYPE_MISMATCH!>Inv<CharSequence>()<!>)
b.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH!>Inv()<!>)
b.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>Inv()<!>)
b.foo3(<!TYPE_MISMATCH!>In<CharSequence>()<!>)