FIR: add UnsafeCall resolution diagnostics
Previously unsafe call is reported as part of InapplicableWrongReceiver. This makes it difficult for the downstream checkers to report different diagnostics.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
43a2ad0467
commit
6a03f31e50
+3
-3
@@ -8,7 +8,7 @@ fun <R> List<R>.a() {}
|
||||
|
||||
fun test1(i: Int?) {
|
||||
1.<!INAPPLICABLE_CANDIDATE!>a<!>()
|
||||
i<!UNSAFE_CALL!>.<!>a()
|
||||
i.<!INAPPLICABLE_CANDIDATE!>a<!>()
|
||||
}
|
||||
|
||||
fun <R> test2(c: Collection<R>) {
|
||||
@@ -19,7 +19,7 @@ fun Int.foo() {}
|
||||
|
||||
fun test3(s: String?) {
|
||||
"".<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
s<!UNSAFE_CALL!>.<!>foo()
|
||||
s.<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
"".foo(<!TOO_MANY_ARGUMENTS!>1<!>)
|
||||
s.foo(<!TOO_MANY_ARGUMENTS!>"a"<!>)
|
||||
}
|
||||
@@ -52,5 +52,5 @@ fun test7(l: List<String?>) {
|
||||
}
|
||||
|
||||
fun test8(l: List<Any>?) {
|
||||
l<!UNSAFE_CALL!>.<!>b()
|
||||
l.<!INAPPLICABLE_CANDIDATE!>b<!>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user