FIR IDE: Enable ReplaceInfixOrOperatorCallFix for UNSAFE_CALL,

UNSAFE_INFIX_CALL, UNSAFE_OPERATOR_CALL.
This commit is contained in:
Mark Punzalan
2021-05-24 17:58:34 +00:00
committed by teamcityserver
parent 5a7f4ffc99
commit ca7649edbb
25 changed files with 63 additions and 75 deletions
@@ -0,0 +1,4 @@
// "Replace with safe (?.) call" "true"
operator fun Int.get(row: Int, column: Int) = this
fun foo(arg: Int?) = arg?.get(42, 13) ?: <caret>
@@ -1,6 +1,4 @@
// "Replace with safe (?.) call" "true"
operator fun Int.get(row: Int, column: Int) = this
fun foo(arg: Int?) = arg<caret>[42, 13]
/* IGNORE_FIR */
fun foo(arg: Int?) = arg<caret>[42, 13]
@@ -1,6 +1,4 @@
// "Replace with safe (?.) call" "true"
operator fun Int.get(row: Int, column: Int) = this
fun foo(arg: Int?) = arg?.get(42, 13)
/* IGNORE_FIR */
fun foo(arg: Int?) = arg?.get(42, 13)
@@ -1,6 +1,4 @@
// "Replace with safe (?.) call" "true"
operator fun Int.plus(index: Int) = this
fun fox(arg: Int?) = arg <caret>+ 42
/* IGNORE_FIR */
fun fox(arg: Int?) = arg <caret>+ 42
@@ -1,6 +1,4 @@
// "Replace with safe (?.) call" "true"
operator fun Int.plus(index: Int) = this
fun fox(arg: Int?) = arg?.plus(42)
/* IGNORE_FIR */
fun fox(arg: Int?) = arg?.plus(42)
@@ -3,6 +3,4 @@
operator fun Int.set(row: Int, column: Int, value: Int) {}
fun foo(arg: Int?) {
arg<caret>[42, 13] = 0
}
/* IGNORE_FIR */
}
@@ -3,6 +3,4 @@
operator fun Int.set(row: Int, column: Int, value: Int) {}
fun foo(arg: Int?) {
arg?.set(42, 13, 0)
}
/* IGNORE_FIR */
}
+1 -3
View File
@@ -3,6 +3,4 @@
fun foo(array: Array<String>?) {
array<caret>[0]
}
/* IGNORE_FIR */
}
@@ -3,6 +3,4 @@
fun foo(array: Array<String>?) {
array?.get(0)
}
/* IGNORE_FIR */
}
@@ -3,6 +3,4 @@
fun foo(array: Array<String>?) {
array<caret>[0] = ""
}
/* IGNORE_FIR */
}
@@ -3,6 +3,4 @@
fun foo(array: Array<String>?) {
array?.set(0, "")
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(array: Array<String>?) {
var s = ""
s = array[0]<caret>
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(array: Array<String>?) {
var s = ""
s = array?.get(0) ?: <caret>
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(bar: Int?) {
var i: Int = 1
i = bar +<caret> 1
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(bar: Int?) {
var i: Int = 1
i = bar?.plus(1) ?: <caret>
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(list: List<String>?) {
var s = ""
s = list[0]<caret>
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(list: List<String>?) {
var s = ""
s = list?.get(0) ?: <caret>
}
/* IGNORE_FIR */
}
@@ -3,6 +3,4 @@
fun foo(bar: Int?) {
bar +<caret> 1
}
/* IGNORE_FIR */
}
@@ -3,6 +3,4 @@
fun foo(bar: Int?) {
bar?.plus(1)
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(list: List<String>?) {
var s = ""
s = list[0]<caret> ?: ""
}
/* IGNORE_FIR */
}
@@ -4,6 +4,4 @@
fun foo(list: List<String>?) {
var s = ""
s = list?.get(0) ?: ""
}
/* IGNORE_FIR */
}
+1 -3
View File
@@ -3,6 +3,4 @@
fun foo(list: List<String>?) {
list<caret>[0]
}
/* IGNORE_FIR */
}
@@ -3,6 +3,4 @@
fun foo(list: List<String>?) {
list?.get(0)
}
/* IGNORE_FIR */
}