Refactoring: make "replace get or set" an inspection
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test<caret>[1, 2, { i ->
|
||||
i
|
||||
}]
|
||||
}
|
||||
|
||||
fun withSuppression() {
|
||||
class Test{
|
||||
operator fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
|
||||
val test = Test()
|
||||
|
||||
@Suppress("ReplaceGetOrSet")
|
||||
test.get(1, 2) { i -> i }
|
||||
}
|
||||
Reference in New Issue
Block a user