KT-12628: replace infix call supports now array accesses too
(cherry picked from commit 3d67f84)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
c439a751ab
commit
47493c1a65
@@ -0,0 +1,4 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
|
||||
operator fun Int.get(row: Int, column: Int) = this
|
||||
fun foo(arg: Int?) = arg<caret>[42, 13]
|
||||
@@ -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)
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
|
||||
operator fun Int.set(row: Int, column: Int, value: Int) {}
|
||||
fun foo(arg: Int?) {
|
||||
arg<caret>[42, 13] = 0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
|
||||
operator fun Int.set(row: Int, column: Int, value: Int) {}
|
||||
fun foo(arg: Int?) {
|
||||
arg?.set(42, 13, 0)
|
||||
}
|
||||
Reference in New Issue
Block a user