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
+10
-10
@@ -38,13 +38,13 @@ fun test() {
|
||||
|
||||
if (out != null && ins != null || out != null) {
|
||||
ins?.read();
|
||||
ins.<!NONE_APPLICABLE!>read<!>();
|
||||
ins<!UNSAFE_CALL!>.<!>read();
|
||||
out.println();
|
||||
}
|
||||
|
||||
if (out == null || out.println(0) == Unit) {
|
||||
out?.println(1)
|
||||
out.println(<!TOO_MANY_ARGUMENTS!>1<!>)
|
||||
out.<!NONE_APPLICABLE!>println<!>(1)
|
||||
}
|
||||
else {
|
||||
out.println(2)
|
||||
@@ -66,11 +66,11 @@ fun test() {
|
||||
|
||||
if (1 == 2 || out != null && out.println(1) == Unit) {
|
||||
out?.println(2);
|
||||
out.println(<!TOO_MANY_ARGUMENTS!>2<!>);
|
||||
out.<!NONE_APPLICABLE!>println<!>(2);
|
||||
}
|
||||
else {
|
||||
out?.println(3)
|
||||
out.println(<!TOO_MANY_ARGUMENTS!>3<!>)
|
||||
out.<!NONE_APPLICABLE!>println<!>(3)
|
||||
}
|
||||
|
||||
out?.println()
|
||||
@@ -103,7 +103,7 @@ fun test() {
|
||||
|
||||
if (out == null || out.println(0) == Unit) {
|
||||
out?.println(1)
|
||||
out.println(<!TOO_MANY_ARGUMENTS!>1<!>)
|
||||
out.<!NONE_APPLICABLE!>println<!>(1)
|
||||
}
|
||||
else {
|
||||
out.println(2)
|
||||
@@ -114,12 +114,12 @@ fun test() {
|
||||
}
|
||||
else {
|
||||
out?.println();
|
||||
out.<!NONE_APPLICABLE!>println<!>();
|
||||
out<!UNSAFE_CALL!>.<!>println();
|
||||
}
|
||||
|
||||
if (out == null || out.println() == Unit) {
|
||||
out?.println();
|
||||
out.<!NONE_APPLICABLE!>println<!>();
|
||||
out<!UNSAFE_CALL!>.<!>println();
|
||||
}
|
||||
else {
|
||||
out.println();
|
||||
@@ -127,11 +127,11 @@ fun test() {
|
||||
|
||||
if (1 == 2 || out != null && out.println(1) == Unit) {
|
||||
out?.println(2);
|
||||
out.println(<!TOO_MANY_ARGUMENTS!>2<!>);
|
||||
out.<!NONE_APPLICABLE!>println<!>(2);
|
||||
}
|
||||
else {
|
||||
out?.println(3)
|
||||
out.println(<!TOO_MANY_ARGUMENTS!>3<!>)
|
||||
out.<!NONE_APPLICABLE!>println<!>(3)
|
||||
}
|
||||
|
||||
if (1 > 2) {
|
||||
@@ -149,7 +149,7 @@ fun test() {
|
||||
|
||||
while (out2 == null) {
|
||||
out2?.println();
|
||||
out2.<!NONE_APPLICABLE!>println<!>();
|
||||
out2<!UNSAFE_CALL!>.<!>println();
|
||||
}
|
||||
out2.println()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user