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:
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// "Create abstract function 'foo'" "true"
|
||||
abstract class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(<caret>foo(1, "2"))
|
||||
}
|
||||
}
|
||||
idea/testData/quickfix/createFromUsage/createFunction/call/abstract/classNoExplicitReceiver.kt.after
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// "Create abstract function 'foo'" "true"
|
||||
abstract class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(foo(1, "2"))
|
||||
}
|
||||
|
||||
abstract fun foo<caret>(i: Int, s: String): Boolean
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create abstract function 'foo'" "true"
|
||||
abstract class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test(a: A) {
|
||||
bar(a.<caret>foo(1, "2"))
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create abstract function 'foo'" "true"
|
||||
abstract class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test(a: A) {
|
||||
bar(a.foo(1, "2"))
|
||||
}
|
||||
|
||||
abstract fun foo<caret>(i: Int, s: String): Boolean
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// "Create abstract function 'foo'" "true"
|
||||
interface A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(<caret>foo(1, "2"))
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create abstract function 'foo'" "true"
|
||||
interface A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(foo(1, "2"))
|
||||
}
|
||||
|
||||
fun foo<caret>(i: Int, s: String): Boolean
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create abstract function 'foo'" "false"
|
||||
// ACTION: Convert to expression body
|
||||
// ACTION: Create function 'foo'
|
||||
// ACTION: Rename reference
|
||||
// ERROR: Unresolved reference: foo
|
||||
class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(<caret>foo(1, "2"))
|
||||
}
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// "Create abstract function 'foo'" "false"
|
||||
// ACTION: Convert to expression body
|
||||
// ACTION: Create extension function 'foo'
|
||||
// ACTION: Create member function 'foo'
|
||||
// ACTION: Rename reference
|
||||
// ERROR: Unresolved reference: foo
|
||||
abstract class A {
|
||||
fun bar(b: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
bar(B().<caret>foo(1, "2"))
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user