LazyResolveNamespaceComparingTest → LazyResolveRecursiveComparingTest

This commit is contained in:
Evgeny Gerashchenko
2014-01-09 23:50:02 +04:00
parent db13cc6ec2
commit 5319c6e24c
45 changed files with 75 additions and 75 deletions
@@ -0,0 +1,6 @@
package test
annotation class A(val a: Int = 12, val b: String = "Test", val c: String)
A(a = 12, c = "Hello")
object SomeObject
@@ -0,0 +1,16 @@
package test
internal final annotation class A : jet.Annotation {
/*primary*/ public constructor A(/*0*/ a: jet.Int = ..., /*1*/ b: jet.String = ..., /*2*/ c: jet.String)
internal final val a: jet.Int
internal final val b: jet.String
internal final val c: jet.String
}
test.A(a = IntegerValueType(12): IntegerValueType(12), c = "Hello": jet.String) internal object SomeObject {
/*primary*/ private constructor SomeObject()
public class object <class-object-for-SomeObject> : test.SomeObject {
/*primary*/ private constructor <class-object-for-SomeObject>()
}
}
@@ -0,0 +1,6 @@
package test
trait TheTrait {
class object {
}
}
@@ -0,0 +1,8 @@
package test
internal trait TheTrait {
internal class object <class-object-for-TheTrait> {
/*primary*/ private constructor <class-object-for-TheTrait>()
}
}
@@ -0,0 +1,10 @@
package test
class B {
class B {
fun foo(b: B.C) {
}
class C {
}
}
}
@@ -0,0 +1,14 @@
package test
internal final class B {
/*primary*/ public constructor B()
internal final class B {
/*primary*/ public constructor B()
internal final fun foo(/*0*/ b: test.B.B.C): jet.Unit
internal final class C {
/*primary*/ public constructor C()
}
}
}
@@ -0,0 +1,9 @@
package test
open class A {
open fun foo(a: E) {}
}
class B : A() {
override fun foo(a: E) {}
}
@@ -0,0 +1,11 @@
package test
internal open class A {
/*primary*/ public constructor A()
internal open fun foo(/*0*/ a: [ERROR : E]): jet.Unit
}
internal final class B : test.A {
/*primary*/ public constructor B()
internal open override /*1*/ fun foo(/*0*/ a: [ERROR : E]): jet.Unit
}
@@ -0,0 +1,9 @@
package test
// Checks that there is no rewrite error at ANNOTATION slice because of resolving annotations for object in lazy resolve and resolving
// object as property (method tries to resolve annotations too).
BadAnnotation
object SomeObject
val some = SomeObject
@@ -0,0 +1,11 @@
package test
internal val some: test.SomeObject
[ERROR : Unresolved annotation type: BadAnnotation]() internal object SomeObject {
/*primary*/ private constructor SomeObject()
public class object <class-object-for-SomeObject> : test.SomeObject {
/*primary*/ private constructor <class-object-for-SomeObject>()
}
}
@@ -0,0 +1,8 @@
package test
BadAnnotation(1)
object SomeObject
val some = SomeObject
annotation class BadAnnotation(s: String)
@@ -0,0 +1,15 @@
package test
internal val some: test.SomeObject
internal final annotation class BadAnnotation : jet.Annotation {
/*primary*/ public constructor BadAnnotation(/*0*/ s: jet.String)
}
test.BadAnnotation(s = IntegerValueType(1): IntegerValueType(1)) internal object SomeObject {
/*primary*/ private constructor SomeObject()
public class object <class-object-for-SomeObject> : test.SomeObject {
/*primary*/ private constructor <class-object-for-SomeObject>()
}
}
@@ -0,0 +1,7 @@
package test
class Some {
TestAnnotation class object {
annotation class TestAnnotation
}
}
@@ -0,0 +1,13 @@
package test
internal final class Some {
/*primary*/ public constructor Some()
test.Some.TestAnnotation() internal class object <class-object-for-Some> {
/*primary*/ private constructor <class-object-for-Some>()
internal final annotation class TestAnnotation : jet.Annotation {
/*primary*/ public constructor TestAnnotation()
}
}
}
@@ -0,0 +1,9 @@
package test
open class ToResolve<SomeClass>(f : (Int) -> Int)
fun testFun(a : Int) = 12
class TestSome<P> {
class object : ToResolve<P>({testFun(it)}) {
}
}
@@ -0,0 +1,15 @@
package test
internal fun testFun(/*0*/ a: jet.Int): jet.Int
internal final class TestSome</*0*/ P> {
/*primary*/ public constructor TestSome</*0*/ P>()
internal class object <class-object-for-TestSome> : test.ToResolve<P> {
/*primary*/ private constructor <class-object-for-TestSome>()
}
}
internal open class ToResolve</*0*/ SomeClass> {
/*primary*/ public constructor ToResolve</*0*/ SomeClass>(/*0*/ f: (jet.Int) -> jet.Int)
}
@@ -0,0 +1,6 @@
package test
enum class Test(a : Int) {
A : Test(0)
B : Test(0) {}
}
@@ -0,0 +1,37 @@
package test
internal final enum class Test : jet.Enum<test.Test> {
/*primary*/ private constructor Test(/*0*/ a: jet.Int)
public final override /*1*/ /*fake_override*/ fun name(): jet.String
public final override /*1*/ /*fake_override*/ fun ordinal(): jet.Int
public class object <class-object-for-Test> {
/*primary*/ private constructor <class-object-for-Test>()
public final /*synthesized*/ fun valueOf(/*0*/ value: jet.String): test.Test
public final /*synthesized*/ fun values(): jet.Array<test.Test>
}
public enum entry A : test.Test {
/*primary*/ private constructor A()
public final override /*1*/ /*fake_override*/ fun name(): jet.String
public final override /*1*/ /*fake_override*/ fun ordinal(): jet.Int
public class object <class-object-for-A> : test.Test.A {
/*primary*/ private constructor <class-object-for-A>()
public final override /*1*/ /*fake_override*/ fun name(): jet.String
public final override /*1*/ /*fake_override*/ fun ordinal(): jet.Int
}
}
public enum entry B : test.Test {
/*primary*/ private constructor B()
public final override /*1*/ /*fake_override*/ fun name(): jet.String
public final override /*1*/ /*fake_override*/ fun ordinal(): jet.Int
public class object <class-object-for-B> : test.Test.B {
/*primary*/ private constructor <class-object-for-B>()
public final override /*1*/ /*fake_override*/ fun name(): jet.String
public final override /*1*/ /*fake_override*/ fun ordinal(): jet.Int
}
}
}
@@ -0,0 +1,15 @@
// FILE: fileDependencyRecursion.kt
package test
import testOther.some
val normal: Int = 1
val fromImported: Int = some
// FILE: fileDependencyRecursionOther.kt
package testOther
import test.normal
val some: Int = 1
val fromImported: Int = normal
@@ -0,0 +1,4 @@
package test
internal val fromImported: jet.Int
internal val normal: jet.Int
@@ -0,0 +1,3 @@
package test
fun <T> foo(t : T) : T {}
@@ -0,0 +1,3 @@
package test
internal fun </*0*/ T> foo(/*0*/ t: T): T
@@ -0,0 +1,13 @@
// FILE: importFunctionWithAllUnderImport.kt
package test
import testOther.*
class B: A()
val inferTypeFromImportedFun = testFun()
// FILE: importFunctionWithAllUnderImportOther.kt
package testOther
open class A
fun testFun() = 1
@@ -0,0 +1,7 @@
package test
internal val inferTypeFromImportedFun: jet.Int
internal final class B : testOther.A {
/*primary*/ public constructor B()
}
@@ -0,0 +1,22 @@
//FILE:mainFile.kt
//----------------------------------------------------------------------------------
package test
import testing.other.*
import testing.TestFun
// Resolve should be ambiguous
val a = TestFun()
//FILE:testing.kt
//----------------------------------------------------------------------------------
package testing
class TestFun
//FILE:testingOther.kt
//----------------------------------------------------------------------------------
package testing.other
fun TestFun() = 12
@@ -0,0 +1,3 @@
package test
internal val a: [ERROR : Type for TestFun()]
@@ -0,0 +1,9 @@
package test
class A {
object B {
fun foo(a: Int) : String {
return ""
}
}
}
@@ -0,0 +1,15 @@
package test
internal final class A {
/*primary*/ public constructor A()
internal object B {
/*primary*/ private constructor B()
internal final fun foo(/*0*/ a: jet.Int): jet.String
public class object <class-object-for-B> : test.A.B {
/*primary*/ private constructor <class-object-for-B>()
internal final override /*1*/ /*fake_override*/ fun foo(/*0*/ a: jet.Int): jet.String
}
}
}
@@ -0,0 +1,7 @@
package test
object SomeObject {
fun test(a: Int) : Int {
return 0
}
}
@@ -0,0 +1,11 @@
package test
internal object SomeObject {
/*primary*/ private constructor SomeObject()
internal final fun test(/*0*/ a: jet.Int): jet.Int
public class object <class-object-for-SomeObject> : test.SomeObject {
/*primary*/ private constructor <class-object-for-SomeObject>()
internal final override /*1*/ /*fake_override*/ fun test(/*0*/ a: jet.Int): jet.Int
}
}
@@ -0,0 +1,4 @@
package test
object Bar {
}
@@ -0,0 +1,9 @@
package test
internal object Bar {
/*primary*/ private constructor Bar()
public class object <class-object-for-Bar> : test.Bar {
/*primary*/ private constructor <class-object-for-Bar>()
}
}
@@ -0,0 +1,17 @@
// FILE: propertyClassFileDependencyRecursion.kt
package test
import other.prop
// Note: "prop" is expected to be unresolved and replaced to Any
class PropType: prop
// Note: this time "prop" should be resolved and type should be inferred for "checkTypeProp"
val checkTypeProp = prop
// FILE: propertyClassFileDependencyRecursionOther.kt
package other
import test.PropType
val prop: PropType? = null
@@ -0,0 +1,7 @@
package test
internal val checkTypeProp: test.PropType?
internal final class PropType {
/*primary*/ public constructor PropType()
}
@@ -0,0 +1,9 @@
package test
class Test {
fun test(): Int = 12
class object {
val a = test() // Check if resolver will be able to infer type of a variable
}
}
@@ -0,0 +1,11 @@
package test
internal final class Test {
/*primary*/ public constructor Test()
internal final fun test(): jet.Int
internal class object <class-object-for-Test> {
/*primary*/ private constructor <class-object-for-Test>()
internal final val a: jet.Int
}
}
@@ -0,0 +1,10 @@
// FILE: SameClassNameResolveTest.kt
package test
open class Base
class SubBase: Base()
// FILE: SameClassNameResolveRoot.kt
open class Base
class SubBase: Base()
@@ -0,0 +1,9 @@
package test
internal open class Base {
/*primary*/ public constructor Base()
}
internal final class SubBase : test.Base {
/*primary*/ public constructor SubBase()
}
@@ -0,0 +1,19 @@
// FILE: a.kt
package test
class A {}
// FILE: b.kt
package test.p; class C {fun f() {}}
// FILE: c.kt
package test.p; open class G<T> {open fun f(): T {} fun a() {}}
// FILE: d.kt
package test.p; class G2<E> : G<E> { fun g() : E {} override fun f() : E {}}
// FILE: e.kt
package test.p; fun foo() {}
// FILE: f.kt
package test.p; fun foo(a: C) {}
@@ -0,0 +1,28 @@
package test
internal final class A {
/*primary*/ public constructor A()
}
package test.p {
internal fun foo(): jet.Unit
internal fun foo(/*0*/ a: test.p.C): jet.Unit
internal final class C {
/*primary*/ public constructor C()
internal final fun f(): jet.Unit
}
internal open class G</*0*/ T> {
/*primary*/ public constructor G</*0*/ T>()
internal final fun a(): jet.Unit
internal open fun f(): T
}
internal final class G2</*0*/ E> : test.p.G<E> {
/*primary*/ public constructor G2</*0*/ E>()
internal final override /*1*/ /*fake_override*/ fun a(): jet.Unit
internal open override /*1*/ fun f(): E
internal final fun g(): E
}
}
@@ -0,0 +1,5 @@
package test
class CompositeIterator<T>(vararg iterators: java.util.Iterator<T>){
val iteratorsIter = iterators.iterator()
}
@@ -0,0 +1,6 @@
package test
internal final class CompositeIterator</*0*/ T> {
/*primary*/ public constructor CompositeIterator</*0*/ T>(/*0*/ vararg iterators: java.util.Iterator<T> /*jet.Array<java.util.Iterator<T>>*/)
internal final val iteratorsIter: jet.Iterator<java.util.Iterator<T>>
}