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
Vendored
+2
-2
@@ -17,7 +17,7 @@ FILE: booleanElvisBoundSmartcast.kt
|
||||
R|<local>/a|.R|/A.foo|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ FILE: booleanElvisBoundSmartcast.kt
|
||||
public final fun test_2(a: R|A?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
R|<local>/a|?.{ $subj$.R|/A.b| } ?: Boolean(true) -> {
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/a|.R|/A.foo|()
|
||||
|
||||
+8
-8
@@ -46,7 +46,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
17 [label="Enter block"];
|
||||
18 [label="Access variable R|<local>/b|"];
|
||||
19 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
19 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
20 [label="Exit block"];
|
||||
}
|
||||
21 [label="Exit when branch result"];
|
||||
@@ -130,7 +130,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
50 [label="Enter block"];
|
||||
51 [label="Access variable R|<local>/b|"];
|
||||
52 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
52 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
53 [label="Exit block"];
|
||||
}
|
||||
54 [label="Exit when branch result"];
|
||||
@@ -205,7 +205,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
77 [label="Enter block"];
|
||||
78 [label="Access variable R|<local>/b|"];
|
||||
79 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
79 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
80 [label="Exit block"];
|
||||
}
|
||||
81 [label="Exit when branch result"];
|
||||
@@ -271,7 +271,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
98 [label="Enter block"];
|
||||
99 [label="Access variable R|<local>/b|"];
|
||||
100 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
100 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
101 [label="Exit block"];
|
||||
}
|
||||
102 [label="Exit when branch result"];
|
||||
@@ -355,7 +355,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
131 [label="Enter block"];
|
||||
132 [label="Access variable R|<local>/b|"];
|
||||
133 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
133 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
134 [label="Exit block"];
|
||||
}
|
||||
135 [label="Exit when branch result"];
|
||||
@@ -421,7 +421,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
152 [label="Enter block"];
|
||||
153 [label="Access variable R|<local>/b|"];
|
||||
154 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
154 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
155 [label="Exit block"];
|
||||
}
|
||||
156 [label="Exit when branch result"];
|
||||
@@ -496,7 +496,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
179 [label="Enter block"];
|
||||
180 [label="Access variable R|<local>/b|"];
|
||||
181 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
181 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
182 [label="Exit block"];
|
||||
}
|
||||
183 [label="Exit when branch result"];
|
||||
@@ -580,7 +580,7 @@ digraph equalsToBoolean_kt {
|
||||
color=blue
|
||||
212 [label="Enter block"];
|
||||
213 [label="Access variable R|<local>/b|"];
|
||||
214 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
|
||||
214 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
|
||||
215 [label="Exit block"];
|
||||
}
|
||||
216 [label="Exit when branch result"];
|
||||
|
||||
+8
-8
@@ -12,7 +12,7 @@ FILE: equalsToBoolean.kt
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ FILE: equalsToBoolean.kt
|
||||
public final fun test_2(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
!=(==(R|<local>/b|, Boolean(true)), Boolean(true)) -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
@@ -31,7 +31,7 @@ FILE: equalsToBoolean.kt
|
||||
public final fun test_3(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
==(==(R|<local>/b|, Boolean(true)), Boolean(false)) -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
@@ -45,7 +45,7 @@ FILE: equalsToBoolean.kt
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ FILE: equalsToBoolean.kt
|
||||
public final fun test_5(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
==(!=(R|<local>/b|, Boolean(true)), Boolean(true)) -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
@@ -67,7 +67,7 @@ FILE: equalsToBoolean.kt
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ FILE: equalsToBoolean.kt
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ FILE: equalsToBoolean.kt
|
||||
public final fun test_8(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
!=(!=(R|<local>/b|, Boolean(true)), Boolean(false)) -> {
|
||||
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
|
||||
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
|
||||
+6
-6
@@ -267,7 +267,7 @@ digraph jumpFromRhsOfOperator_kt {
|
||||
101 [label="Exit ||"];
|
||||
}
|
||||
102 [label="Access variable R|<local>/a|"];
|
||||
103 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
|
||||
103 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
|
||||
104 [label="Exit block"];
|
||||
}
|
||||
105 [label="Exit function test_5" style="filled" fillcolor=red];
|
||||
@@ -309,7 +309,7 @@ digraph jumpFromRhsOfOperator_kt {
|
||||
117 [label="Exit &&"];
|
||||
}
|
||||
118 [label="Access variable R|<local>/a|"];
|
||||
119 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
|
||||
119 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
|
||||
120 [label="Exit block"];
|
||||
}
|
||||
121 [label="Exit function teat_6" style="filled" fillcolor=red];
|
||||
@@ -364,14 +364,14 @@ digraph jumpFromRhsOfOperator_kt {
|
||||
color=blue
|
||||
139 [label="Enter block"];
|
||||
140 [label="Access variable R|<local>/a|"];
|
||||
141 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
|
||||
141 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
|
||||
142 [label="Exit block"];
|
||||
}
|
||||
143 [label="Exit when branch result"];
|
||||
144 [label="Exit when"];
|
||||
}
|
||||
145 [label="Access variable R|<local>/a|"];
|
||||
146 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
|
||||
146 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
|
||||
147 [label="Exit block"];
|
||||
}
|
||||
148 [label="Exit function test_7" style="filled" fillcolor=red];
|
||||
@@ -437,14 +437,14 @@ digraph jumpFromRhsOfOperator_kt {
|
||||
color=blue
|
||||
166 [label="Enter block"];
|
||||
167 [label="Access variable R|<local>/a|"];
|
||||
168 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
|
||||
168 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
|
||||
169 [label="Exit block"];
|
||||
}
|
||||
170 [label="Exit when branch result"];
|
||||
171 [label="Exit when"];
|
||||
}
|
||||
172 [label="Access variable R|<local>/a|"];
|
||||
173 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
|
||||
173 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
|
||||
174 [label="Exit block"];
|
||||
}
|
||||
175 [label="Exit function test_8" style="filled" fillcolor=red];
|
||||
|
||||
Vendored
+6
-6
@@ -31,27 +31,27 @@ FILE: jumpFromRhsOfOperator.kt
|
||||
}
|
||||
public final fun test_5(a: R|A?|): R|kotlin/Unit| {
|
||||
==(R|<local>/a|, Null(null)) || throw R|java/lang/Exception.Exception|()
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
public final fun teat_6(a: R|A?|): R|kotlin/Unit| {
|
||||
!=(R|<local>/a|, Null(null)) && throw R|java/lang/Exception.Exception|()
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
public final fun test_7(a: R|A?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
==(R|<local>/a|, Null(null)) || throw R|java/lang/Exception.Exception|() -> {
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
}
|
||||
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
public final fun test_8(a: R|A?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
!=(R|<local>/a|, Null(null)) && throw R|java/lang/Exception.Exception|() -> {
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
}
|
||||
|
||||
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
|
||||
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user