Create From Usage ("set" operation): Support expressions of the form a[i]++

This commit is contained in:
Alexey Sedunov
2014-10-20 21:10:33 +04:00
parent b5e1fe613c
commit b2588f610a
7 changed files with 58 additions and 7 deletions
@@ -0,0 +1,13 @@
// "Create function 'set' from usage" "true"
class A {
fun get(s: String): Int = 1
fun set(s: String, value: Int) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun foo() {
var a = A()
a["1"]++
}
@@ -0,0 +1,9 @@
// "Create function 'set' from usage" "true"
class A {
fun get(s: String): Int = 1
}
fun foo() {
var a = A()
a<caret>["1"]++
}