Property <-> Function Conversion: Add/remove 'get'/'is' prefixes automatically
#KT-8812 Fixed
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package test
|
||||
|
||||
interface T {
|
||||
fun foo(): Boolean
|
||||
fun getFoo(): Boolean
|
||||
}
|
||||
|
||||
open class A(val n: Int): T {
|
||||
override fun foo(): Boolean = n > 1
|
||||
override fun getFoo(): Boolean = n > 1
|
||||
}
|
||||
|
||||
class B: A(1) {
|
||||
override fun foo(): Boolean = true
|
||||
override fun getFoo(): Boolean = true
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a = A(1).foo()
|
||||
val b = B().foo()
|
||||
val a = A(1).getFoo()
|
||||
val b = B().getFoo()
|
||||
}
|
||||
Reference in New Issue
Block a user