FIR checker: report UNSAFE_CALL for overloaded function calls
Previously if an unsafe call is to an overloaded function, FIR checkers report NONE_APPLICABLE. This change instead report them as UNSAFE_CALL or its variants.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
92df1f575a
commit
454ae3b17a
+1
-1
@@ -16,7 +16,7 @@ fun foo(): Int {
|
||||
k.run()
|
||||
val d: Int = c
|
||||
// a is not null because of k constructor, but we do not know it
|
||||
return a <!NONE_APPLICABLE!>+<!> d
|
||||
return a <!UNSAFE_OPERATOR_CALL!>+<!> d
|
||||
}
|
||||
else return -1
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ fun foo(): Int {
|
||||
}
|
||||
k.run()
|
||||
val d: Int = c
|
||||
return a <!NONE_APPLICABLE!>+<!> d
|
||||
return a <!UNSAFE_OPERATOR_CALL!>+<!> d
|
||||
}
|
||||
else return -1
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fun foo(): Int {
|
||||
}
|
||||
k.run()
|
||||
val d: Int = c
|
||||
return a <!NONE_APPLICABLE!>+<!> d
|
||||
return a <!UNSAFE_OPERATOR_CALL!>+<!> d
|
||||
}
|
||||
else return -1
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fun bar(arg: Long?): Long {
|
||||
return i<!UNSAFE_CALL!>--<!> + i
|
||||
}
|
||||
if (i++ == 7L) {
|
||||
return i++ <!NONE_APPLICABLE!>+<!> i
|
||||
return i++ <!UNSAFE_OPERATOR_CALL!>+<!> i
|
||||
}
|
||||
return 0L
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
fun foo(): Int {
|
||||
var i: Int? = 42
|
||||
i = null
|
||||
return i <!NONE_APPLICABLE!>+<!> 1
|
||||
return i <!UNSAFE_OPERATOR_CALL!>+<!> 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user