Move top-level declarations to separate file: Refactoring processor and tests

This commit is contained in:
Alexey Sedunov
2014-03-20 15:34:04 +04:00
parent 6ddcd51af2
commit 5aa75ba3e1
216 changed files with 1770 additions and 42 deletions
@@ -0,0 +1,5 @@
package a
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package a
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,7 @@
package a
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package a
class Test {
fun foo() {
b.test()
}
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package a
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package a;
import static b.BPackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,16 @@
package b
open class Foo {
open class Bar {
}
}
fun test {
val aFoo: a.Foo = a.Foo()
val bFoo: Foo = Foo()
val cFoo: c.Foo = c.Foo()
val aBar: a.Foo.Bar = a.Foo.Bar()
val bBar: Foo.Bar = Foo.Bar()
val cBar: c.Foo.Bar = c.Foo.Bar()
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,5 @@
package b
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package b
import a.*
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package b
import b.test
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package b
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package b;
import static b.BPackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,7 @@
package c
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,5 @@
package c
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package c
import a.*
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package c
import b.test
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package c
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package c;
import static b.BPackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package a
import a.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,7 @@
package a
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,16 @@
package a
fun <caret>test {
val aFoo: Foo = Foo()
val bFoo: b.Foo = b.Foo()
val cFoo: c.Foo = c.Foo()
val aBar: Foo.Bar = Foo.Bar()
val bBar: b.Foo.Bar = b.Foo.Bar()
val cBar: c.Foo.Bar = c.Foo.Bar()
}
class Test {
fun foo() {
test()
}
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
APackage.test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
test()
}
@@ -0,0 +1,9 @@
package a;
import static a.APackage.*;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,7 @@
package a
import a.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package a;
import static a.APackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,8 @@
package b
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
a.APackage.test();
}
}
@@ -0,0 +1,5 @@
package b
fun bar() {
a.test()
}
@@ -0,0 +1,9 @@
package b;
import a.*;
class J {
void bar() {
APackage.test();
}
}
@@ -0,0 +1,7 @@
package b
import a.*
fun bar() {
test()
}
@@ -0,0 +1,9 @@
package b;
import static a.APackage.*;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,9 @@
package b;
import a.APackage;
class J {
void bar() {
APackage.test();
}
}
@@ -0,0 +1,7 @@
package b
import a.test
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package b
import a.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package b;
import static a.APackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,7 @@
package c
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
a.APackage.test();
}
}
@@ -0,0 +1,5 @@
package c
fun bar() {
a.test()
}
@@ -0,0 +1,9 @@
package c;
import a.*;
class J {
void bar() {
APackage.test();
}
}
@@ -0,0 +1,7 @@
package c
import a.*
fun bar() {
test()
}
@@ -0,0 +1,9 @@
package c;
import static a.APackage.*;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,9 @@
package c;
import a.APackage;
class J {
void bar() {
APackage.test();
}
}
@@ -0,0 +1,7 @@
package c
import a.test
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package c
import a.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package c;
import static a.APackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,5 @@
{
"mainFile": "a/main.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetFile": "b/dependency.kt"
}