Property <-> Function Conversion: Add/remove 'get'/'is' prefixes automatically
#KT-8812 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import static test.TestPackage.getFoo;
|
||||
|
||||
class J {
|
||||
void test() {
|
||||
boolean b = getFoo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import static test.TestPackage.getFoo;
|
||||
|
||||
class J {
|
||||
void test() {
|
||||
boolean b = getFoo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun <caret>getFoo(): Boolean = true
|
||||
@@ -0,0 +1,4 @@
|
||||
package test
|
||||
|
||||
val foo: Boolean
|
||||
get() = true
|
||||
@@ -0,0 +1,7 @@
|
||||
import static test.TestPackage.isFoo;
|
||||
|
||||
class J {
|
||||
void test() {
|
||||
boolean b = isFoo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import static test.TestPackage.isFoo;
|
||||
|
||||
class J {
|
||||
void test() {
|
||||
boolean b = isFoo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
fun <caret>isFoo(): Boolean = true
|
||||
@@ -0,0 +1,4 @@
|
||||
package test
|
||||
|
||||
val isFoo: Boolean
|
||||
get() = true
|
||||
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
package p
|
||||
|
||||
import p.getFoo
|
||||
|
||||
class A(val n: Int)
|
||||
|
||||
fun A.<caret>getFoo(): Boolean = n > 1
|
||||
|
||||
fun test() {
|
||||
val t = A::getFoo
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// WITH_RUNTIME
|
||||
package p
|
||||
|
||||
import p.foo
|
||||
|
||||
class A(val n: Int)
|
||||
|
||||
val A.foo: Boolean
|
||||
get() = n > 1
|
||||
|
||||
fun test() {
|
||||
val t = A::foo
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
package p
|
||||
|
||||
import p.isFoo
|
||||
|
||||
class A(val n: Int)
|
||||
|
||||
fun A.<caret>isFoo(): Boolean = n > 1
|
||||
|
||||
fun test() {
|
||||
val t = A::isFoo
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// WITH_RUNTIME
|
||||
package p
|
||||
|
||||
import p.isFoo
|
||||
|
||||
class A(val n: Int)
|
||||
|
||||
val A.isFoo: Boolean
|
||||
get() = n > 1
|
||||
|
||||
fun test() {
|
||||
val t = A::isFoo
|
||||
}
|
||||
Reference in New Issue
Block a user