Pull Up/Extract Super: Support members declared in the companion object of the original class

This commit is contained in:
Alexey Sedunov
2016-09-20 19:06:25 +03:00
parent 982d4d4ead
commit 8a5628cde5
18 changed files with 132 additions and 24 deletions
@@ -3,6 +3,7 @@ import org.jetbrains.annotations.NotNull;
abstract class A {
public final int x;
public static final int _x;
public abstract boolean foo(int n);
@@ -1,5 +1,10 @@
// WITH_RUNTIME
abstract class <caret>B: A() {
companion object {
// INFO: {"checked": "true"}
val _x = 1
}
// INFO: {"checked": "true"}
val x = 1
// INFO: {"checked": "true"}
@@ -1,5 +1,6 @@
// WITH_RUNTIME
abstract class B: A() {
// INFO: {"checked": "true"}
val y: Int get() = 2
// INFO: {"checked": "true"}
@@ -2,6 +2,14 @@
open class A
abstract class <caret>B: A() {
companion object {
// INFO: {"checked": "true"}
val _x = 1
// INFO: {"checked": "true"}
fun _foo(n: Int): Boolean = n > 0
}
// INFO: {"checked": "true"}
val x = 1
// INFO: {"checked": "true"}
@@ -24,6 +24,14 @@ abstract class A {
class Y {
}
companion object {
// INFO: {"checked": "true"}
val _x = 1
// INFO: {"checked": "true"}
fun _foo(n: Int): Boolean = n > 0
}
}
abstract class B: A() {
@@ -2,6 +2,14 @@
interface T
abstract class <caret>B: T {
companion object {
// INFO: {"checked": "true"}
val _x = 1
// INFO: {"checked": "true"}
fun foo(n: Int): Boolean = n > 0
}
// INFO: {"checked": "true"}
val x = 1
// INFO: {"checked": "true"}
@@ -19,9 +19,23 @@ interface T {
class Y {
}
companion object {
// INFO: {"checked": "true"}
val _x: Int
// INFO: {"checked": "true"}
fun foo(n: Int): Boolean = n > 0
}
}
abstract class B: T {
companion object {
// INFO: {"checked": "true"}
override val _x = 1
}
// INFO: {"checked": "true"}
override val x = 1
// INFO: {"checked": "true"}