Create From Usage ("set" operation): Support expressions of the form a[i]++
This commit is contained in:
@@ -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"]++
|
||||
}
|
||||
Reference in New Issue
Block a user