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:
+1
@@ -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
|
||||
|
||||
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// "Create abstract property 'foo'" "true"
|
||||
abstract class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(<caret>foo)
|
||||
}
|
||||
}
|
||||
+10
@@ -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)
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create abstract property 'foo'" "true"
|
||||
abstract class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test(a: A) {
|
||||
bar(a.<caret>foo)
|
||||
}
|
||||
}
|
||||
+10
@@ -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)
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create abstract property 'foo'" "true"
|
||||
interface A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(<caret>foo)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create abstract property 'foo'" "true"
|
||||
interface A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
val foo: Boolean<caret>
|
||||
|
||||
fun test() {
|
||||
bar(foo)
|
||||
}
|
||||
}
|
||||
Vendored
+15
@@ -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)
|
||||
}
|
||||
}
|
||||
Vendored
+18
@@ -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 {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user