Create From Usage: Add support of get/set functions in property delegates
#KT-5977 Fixed
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// "Create function 'get' from usage" "true"
|
||||
class F {
|
||||
fun get(x: X, propertyMetadata: PropertyMetadata): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class X {
|
||||
val f: Int by F()
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Create function 'get', function 'set' from usage" "true"
|
||||
class F {
|
||||
fun get(x: X, propertyMetadata: PropertyMetadata): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class X {
|
||||
var f: Int by F()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create function 'get' from usage" "true"
|
||||
class F {
|
||||
fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) { }
|
||||
|
||||
fun get(x: X, propertyMetadata: PropertyMetadata): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
class X {
|
||||
var f: Int by F()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create function 'set' from usage" "true"
|
||||
class F {
|
||||
fun get(x: X, propertyMetadata: PropertyMetadata): Int = 1
|
||||
|
||||
fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
class X {
|
||||
var f: Int by F()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Create function 'get' from usage" "true"
|
||||
class F {
|
||||
|
||||
}
|
||||
|
||||
class X {
|
||||
val f: Int by F()<caret>
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Create function 'get', function 'set' from usage" "true"
|
||||
class F {
|
||||
|
||||
}
|
||||
|
||||
class X {
|
||||
var f: Int by F()<caret>
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create function 'get' from usage" "true"
|
||||
class F {
|
||||
fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) { }
|
||||
}
|
||||
|
||||
class X {
|
||||
var f: Int by F()<caret>
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create function 'set' from usage" "true"
|
||||
class F {
|
||||
fun get(x: X, propertyMetadata: PropertyMetadata): Int = 1
|
||||
}
|
||||
|
||||
class X {
|
||||
var f: Int by F()<caret>
|
||||
}
|
||||
Reference in New Issue
Block a user