Convert member to extension: Support members of header/impl classes
#KT-18883 Fixed
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
header class Foo {
|
||||
fun <caret>foo(n: Int)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
header class Foo {
|
||||
}
|
||||
|
||||
header fun Foo.foo(n: Int)
|
||||
@@ -0,0 +1,5 @@
|
||||
impl class Foo {
|
||||
impl fun foo(n: Int) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl fun Foo.foo(n: Int) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
impl class Foo {
|
||||
impl fun foo(n: Int) {
|
||||
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl fun Foo.foo(n: Int) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
header class Foo {
|
||||
fun foo(n: Int)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
header class Foo {
|
||||
}
|
||||
|
||||
header fun Foo.foo(n: Int)
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
impl class Foo {
|
||||
impl fun <caret>foo(n: Int) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl fun Foo.foo(n: Int) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
impl class Foo {
|
||||
impl fun foo(n: Int) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl fun Foo.foo(n: Int) {
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
header class Foo {
|
||||
val <caret>foo: Int
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
header class Foo {
|
||||
}
|
||||
|
||||
header val Foo.foo: Int
|
||||
@@ -0,0 +1,3 @@
|
||||
impl class Foo {
|
||||
impl val foo get() = 1
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl val Foo.foo get() = 1
|
||||
@@ -0,0 +1,3 @@
|
||||
impl class Foo {
|
||||
impl val foo get() = 2
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl val Foo.foo get() = 2
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// "Convert member to extension" "false"
|
||||
// ACTION: Convert property to function
|
||||
// ACTION: Introduce backing property
|
||||
// ACTION: Move to companion object
|
||||
// ACTION: Move to constructor
|
||||
|
||||
header class Foo {
|
||||
val <caret>foo: Int
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
impl class Foo {
|
||||
impl val foo = 1
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
impl class Foo {
|
||||
impl val foo get() = 2
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
header class Foo {
|
||||
val foo: Int
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
header class Foo {
|
||||
}
|
||||
|
||||
header val Foo.foo: Int
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
impl class Foo {
|
||||
impl val <caret>foo get() = 1
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Convert member to extension" "true"
|
||||
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl val Foo.foo get() = 1
|
||||
@@ -0,0 +1,3 @@
|
||||
impl class Foo {
|
||||
impl val foo get() = 2
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
impl class Foo {
|
||||
}
|
||||
|
||||
impl val Foo.foo get() = 2
|
||||
Reference in New Issue
Block a user