Create from Usage: Support "Create abstract function/property" inside an abstract class

#KT-7492 Fixed
(cherry picked from commit 75f6b7f)
This commit is contained in:
Alexey Sedunov
2016-06-27 12:05:10 +03:00
parent 3ba776fffa
commit 49b6811b44
24 changed files with 370 additions and 22 deletions
@@ -2,6 +2,7 @@
// ACTION: Convert to expression body
// ACTION: Create local variable 'foo'
// ACTION: Create property 'foo'
// ACTION: Create abstract property 'foo'
// ACTION: Rename reference
// ERROR: Unresolved reference: foo
@@ -0,0 +1,8 @@
// "Create abstract property 'foo'" "true"
abstract class A {
fun bar(b: Boolean) {}
fun test() {
bar(<caret>foo)
}
}
@@ -0,0 +1,10 @@
// "Create abstract property 'foo'" "true"
abstract class A {
fun bar(b: Boolean) {}
abstract val foo: Boolean<caret>
fun test() {
bar(foo)
}
}
@@ -0,0 +1,8 @@
// "Create abstract property 'foo'" "true"
abstract class A {
fun bar(b: Boolean) {}
fun test(a: A) {
bar(a.<caret>foo)
}
}
@@ -0,0 +1,10 @@
// "Create abstract property 'foo'" "true"
abstract class A {
fun bar(b: Boolean) {}
abstract val foo: Boolean<caret>
fun test(a: A) {
bar(a.foo)
}
}
@@ -0,0 +1,8 @@
// "Create abstract property 'foo'" "true"
interface A {
fun bar(b: Boolean) {}
fun test() {
bar(<caret>foo)
}
}
@@ -0,0 +1,10 @@
// "Create abstract property 'foo'" "true"
interface A {
fun bar(b: Boolean) {}
val foo: Boolean<caret>
fun test() {
bar(foo)
}
}
@@ -0,0 +1,15 @@
// "Create abstract property 'foo'" "false"
// ACTION: Convert to expression body
// ACTION: Create local variable 'foo'
// ACTION: Create parameter 'foo'
// ACTION: Create property 'foo'
// ACTION: Create property 'foo' as constructor parameter
// ACTION: Rename reference
// ERROR: Unresolved reference: foo
class A {
fun bar(b: Boolean) {}
fun test() {
bar(<caret>foo)
}
}
@@ -0,0 +1,18 @@
// "Create abstract property 'foo'" "false"
// ACTION: Convert to expression body
// ACTION: Create extension property 'foo'
// ACTION: Create member property 'foo'
// ACTION: Create property 'foo' as constructor parameter
// ACTION: Rename reference
// ERROR: Unresolved reference: foo
abstract class A {
fun bar(b: Boolean) {}
fun test() {
bar(B().<caret>foo)
}
}
class B {
}