Push Down: Support moving members from Java to Kotlin class

#KT-9485 Fixed
This commit is contained in:
Alexey Sedunov
2016-09-22 20:19:36 +03:00
parent 924bb44862
commit 956c6eeec7
67 changed files with 604 additions and 161 deletions
+1
View File
@@ -0,0 +1 @@
class K : A()
@@ -0,0 +1,28 @@
abstract class K : A() {
// INFO: {"checked": "true"}
var x = 2 * 3
// INFO: {"checked": "true"}
internal inner class X
// INFO: {"checked": "true"}
internal class Y
// INFO: {"checked": "true"}
fun foo(n: Int): Boolean {
return n > 0
}
// INFO: {"checked": "true"}
internal abstract fun bar(s: String): Int
companion object {
// INFO: {"checked": "true"}
var X = "1" + "2"
// INFO: {"checked": "true"}
fun foo2(n: Int): String {
return "_" + n + "_"
}
}
}
+29
View File
@@ -0,0 +1,29 @@
abstract class <caret>A {
// INFO: {"checked": "true"}
int x = 2 * 3;
// INFO: {"checked": "true"}
static String X = "1" + "2";
// INFO: {"checked": "true"}
boolean foo(int n) {
return n > 0;
}
// INFO: {"checked": "true"}
static String foo2(int n) {
return "_" + n + "_";
}
// INFO: {"checked": "true"}
abstract int bar(String s);
// INFO: {"checked": "true"}
class X {
}
// INFO: {"checked": "true"}
static class Y {
}
}
@@ -0,0 +1,3 @@
abstract class A {
}
@@ -0,0 +1 @@
class K : A()
@@ -0,0 +1,28 @@
abstract class K : A() {
// INFO: {"checked": "true"}
var x = 2 * 3
// INFO: {"checked": "true"}
internal inner class X
// INFO: {"checked": "true"}
internal class Y
// INFO: {"checked": "true", "toAbstract": "true"}
override fun foo(n: Int): Boolean {
return n > 0
}
// INFO: {"checked": "true"}
internal abstract fun bar(s: String): Int
companion object {
// INFO: {"checked": "true"}
var X = "1" + "2"
// INFO: {"checked": "true"}
fun foo2(n: Int): String {
return "_" + n + "_"
}
}
}
@@ -0,0 +1,29 @@
abstract class <caret>A {
// INFO: {"checked": "true"}
int x = 2 * 3;
// INFO: {"checked": "true"}
static String X = "1" + "2";
// INFO: {"checked": "true", "toAbstract": "true"}
boolean foo(int n) {
return n > 0;
}
// INFO: {"checked": "true"}
static String foo2(int n) {
return "_" + n + "_";
}
// INFO: {"checked": "true"}
abstract int bar(String s);
// INFO: {"checked": "true"}
class X {
}
// INFO: {"checked": "true"}
static class Y {
}
}
@@ -0,0 +1,6 @@
abstract class A {
// INFO: {"checked": "true", "toAbstract": "true"}
abstract boolean foo(int n);
}
@@ -0,0 +1,10 @@
class K : A()
fun test(a: A) {
val t1 = a.x
a.x = t1 + 1
val t2 = A.X
a.foo(1)
A.foo2(2)
A.Y()
}
@@ -0,0 +1,29 @@
abstract class <caret>A {
// INFO: {"checked": "true"}
int x = 2 * 3;
// INFO: {"checked": "true"}
static String X = "1" + "2";
// INFO: {"checked": "true"}
boolean foo(int n) {
return n > 0;
}
// INFO: {"checked": "true"}
static String foo2(int n) {
return "_" + n + "_";
}
// INFO: {"checked": "true"}
abstract int bar(String s);
// INFO: {"checked": "true"}
class X {
}
// INFO: {"checked": "true"}
static class Y {
}
}
@@ -0,0 +1,3 @@
Pushed member won't be available in 'foo(1)'
Pushed member won't be available in 'x'
Pushed member won't be available in 'x'
@@ -0,0 +1,3 @@
class K : I
interface IK: I
@@ -0,0 +1,25 @@
abstract class K : I {
// INFO: {"checked": "true"}
class X
// INFO: {"checked": "true"}
abstract fun bar(s: String): Int
companion object {
// INFO: {"checked": "true"}
val x = 2 * 3
}
}
interface IK: I {
// INFO: {"checked": "true"}
class X
// INFO: {"checked": "true"}
fun bar(s: String): Int
companion object {
// INFO: {"checked": "true"}
val x = 2 * 3
}
}
@@ -0,0 +1,12 @@
interface <caret>I {
// INFO: {"checked": "true"}
int x = 2 * 3;
// INFO: {"checked": "true"}
int bar(String s);
// INFO: {"checked": "true"}
class X {
}
}
@@ -0,0 +1,3 @@
interface I {
}