Create From Usage: Add support of property delegates
This commit is contained in:
+11
@@ -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.
|
||||
}
|
||||
}
|
||||
+11
@@ -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.
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val t: T) {
|
||||
val x: A<Int> by <caret>foo(t, "")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create function 'foo' from usage" "true"
|
||||
|
||||
class A<T>(val t: T) {
|
||||
var x: A<Int> by <caret>foo(t, "")
|
||||
}
|
||||
Reference in New Issue
Block a user