Inline refactoring: should support set/get operator
#KT-17378 Fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class Declaration {
|
||||
operator fun <caret>get(p: Int) = p
|
||||
}
|
||||
|
||||
fun call() {
|
||||
val declaration = Declaration()
|
||||
val vg1 = declaration.get(4)
|
||||
val vg2 = declaration[42].let { it + 1 }
|
||||
val vg3 = Declaration()[42].let { it + 1 }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Declaration {
|
||||
}
|
||||
|
||||
fun call() {
|
||||
val declaration = Declaration()
|
||||
val vg1 = 4
|
||||
val vg2 = 42.let { it + 1 }
|
||||
Declaration()
|
||||
val vg3 = 42.let { it + 1 }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Declaration {
|
||||
operator fun <T> <caret>set(i: Int, e: T) {
|
||||
println(i)
|
||||
println(e)
|
||||
}
|
||||
}
|
||||
|
||||
fun call() {
|
||||
val declaration = Declaration()
|
||||
declaration.set(4, "")
|
||||
declaration[42] = declaration
|
||||
Declaration()[{ 42 }()] = { 4 }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Declaration {
|
||||
}
|
||||
|
||||
fun call() {
|
||||
val declaration = Declaration()
|
||||
println(4)
|
||||
println("")
|
||||
println(42)
|
||||
println(declaration)
|
||||
Declaration()
|
||||
println({ 42 }())
|
||||
println({ 4 })
|
||||
}
|
||||
Reference in New Issue
Block a user