Create From Usage: Add support of property delegates

This commit is contained in:
Alexey Sedunov
2014-10-08 17:46:19 +04:00
parent 2e6d4b3501
commit f0a0df94b5
13 changed files with 125 additions and 10 deletions
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
import kotlin.properties.ReadOnlyProperty
class A<T>(val t: T) {
val x: A<Int> by foo(t, "")
fun <T> foo(t: T, s: String): ReadOnlyProperty<A<T>, A<Int>> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
import kotlin.properties.ReadWriteProperty
class A<T>(val t: T) {
var x: A<Int> by foo(t, "")
fun <T> foo(t: T, s: String): ReadWriteProperty<A<T>, A<Int>> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,5 @@
// "Create function 'foo' from usage" "true"
class A<T>(val t: T) {
val x: A<Int> by <caret>foo(t, "")
}
@@ -0,0 +1,5 @@
// "Create function 'foo' from usage" "true"
class A<T>(val t: T) {
var x: A<Int> by <caret>foo(t, "")
}