From 75c887048e0ff074e1cd695be4ebe1b66b8048c2 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Mon, 1 Dec 2014 20:47:41 +0300 Subject: [PATCH] Drop AbstractLazyResolveRecursiveComparingTest test Test data from compiler/testData/lazyResolve/ was moved to diagnostics tests --- .../propertyClassFileDependencyRecursion.kt | 4 +- .../propertyClassFileDependencyRecursion.txt | 16 +++ .../sameClassNameResolve.kt | 0 .../diagnostics/sameClassNameResolve.txt | 32 +++++ compiler/testData/diagnostics/simpleClass.kt | 19 +++ compiler/testData/diagnostics/simpleClass.txt | 43 ++++++ .../tests/annotations}/AnnotationOnObject.kt | 0 .../tests/annotations/AnnotationOnObject.txt | 28 ++++ .../UnresolvedAnnotationOnObject.kt | 4 +- .../UnresolvedAnnotationOnObject.txt | 19 +++ .../WrongAnnotationArgsOnObject.kt | 8 ++ .../WrongAnnotationArgsOnObject.txt | 27 ++++ .../tests/classObjects/classObjectHeader.kt | 9 ++ .../tests/classObjects/classObjectHeader.txt | 26 ++++ .../resolveFunctionInsideClassObject.kt | 9 ++ .../resolveFunctionInsideClassObject.txt | 20 +++ .../tests}/fileDependencyRecursion.kt | 0 .../tests/fileDependencyRecursion.txt | 11 ++ .../importFunctionWithAllUnderImport.kt | 0 .../importFunctionWithAllUnderImport.txt | 23 ++++ ...ctionWithAllUnderImportAfterNamedImport.kt | 2 +- ...tionWithAllUnderImportAfterNamedImport.txt | 19 +++ .../tests/inner}/InnerClassNameClash.kt | 4 +- .../tests/inner/InnerClassNameClash.txt | 26 ++++ .../tests/override/OverrideWithErrors.kt | 9 ++ .../tests/override/OverrideWithErrors.txt | 20 +++ .../tests/varargs/varargIterator.kt | 5 + .../tests/varargs/varargIterator.txt | 12 ++ .../AnnotationOnObject.txt | 19 --- .../recursiveComparator/CyclicHierarchy.kt | 10 -- .../recursiveComparator/CyclicHierarchy.txt | 25 ---- .../InnerClassNameClash.txt | 14 -- .../recursiveComparator/OverrideWithErrors.kt | 9 -- .../OverrideWithErrors.txt | 11 -- .../UnresolvedAnnotationOnObject.txt | 12 -- .../WrongAnnotationArgsOnObject.kt | 8 -- .../WrongAnnotationArgsOnObject.txt | 18 --- .../recursiveComparator/classObjectHeader.kt | 9 -- .../recursiveComparator/classObjectHeader.txt | 15 -- .../fileDependencyRecursion.txt | 6 - .../importFunctionWithAllUnderImport.txt | 8 -- ...tionWithAllUnderImportAfterNamedImport.txt | 4 - .../propertyClassFileDependencyRecursion.txt | 8 -- .../resolveFunctionInsideClassObject.kt | 9 -- .../resolveFunctionInsideClassObject.txt | 12 -- .../sameClassNameResolve.txt | 9 -- .../recursiveComparator/simpleClass.kt | 19 --- .../recursiveComparator/simpleClass.txt | 28 ---- .../recursiveComparator/varargIterator.kt | 5 - .../recursiveComparator/varargIterator.txt | 7 - .../checkers/JetDiagnosticsTestGenerated.java | 66 +++++++++ ...ractLazyResolveRecursiveComparingTest.java | 80 ----------- ...esolveRecursiveComparingTestGenerated.java | 128 ------------------ .../jet/generators/tests/GenerateTests.kt | 5 - 54 files changed, 454 insertions(+), 485 deletions(-) rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics}/propertyClassFileDependencyRecursion.kt (82%) create mode 100644 compiler/testData/diagnostics/propertyClassFileDependencyRecursion.txt rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics}/sameClassNameResolve.kt (100%) create mode 100644 compiler/testData/diagnostics/sameClassNameResolve.txt create mode 100644 compiler/testData/diagnostics/simpleClass.kt create mode 100644 compiler/testData/diagnostics/simpleClass.txt rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics/tests/annotations}/AnnotationOnObject.kt (100%) create mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.txt rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics/tests/annotations}/UnresolvedAnnotationOnObject.kt (79%) create mode 100644 compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.txt create mode 100644 compiler/testData/diagnostics/tests/classObjects/classObjectHeader.kt create mode 100644 compiler/testData/diagnostics/tests/classObjects/classObjectHeader.txt create mode 100644 compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt create mode 100644 compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.txt rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics/tests}/fileDependencyRecursion.kt (100%) create mode 100644 compiler/testData/diagnostics/tests/fileDependencyRecursion.txt rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics/tests/imports}/importFunctionWithAllUnderImport.kt (100%) create mode 100644 compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.txt rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics/tests/imports}/importFunctionWithAllUnderImportAfterNamedImport.kt (89%) create mode 100644 compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt rename compiler/testData/{lazyResolve/recursiveComparator => diagnostics/tests/inner}/InnerClassNameClash.kt (61%) create mode 100644 compiler/testData/diagnostics/tests/inner/InnerClassNameClash.txt create mode 100644 compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt create mode 100644 compiler/testData/diagnostics/tests/override/OverrideWithErrors.txt create mode 100644 compiler/testData/diagnostics/tests/varargs/varargIterator.kt create mode 100644 compiler/testData/diagnostics/tests/varargs/varargIterator.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/AnnotationOnObject.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.kt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.kt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.kt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.kt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/fileDependencyRecursion.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImport.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.kt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/sameClassNameResolve.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/simpleClass.kt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/simpleClass.txt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/varargIterator.kt delete mode 100644 compiler/testData/lazyResolve/recursiveComparator/varargIterator.txt delete mode 100644 compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveRecursiveComparingTest.java delete mode 100644 compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveRecursiveComparingTestGenerated.java diff --git a/compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.kt b/compiler/testData/diagnostics/propertyClassFileDependencyRecursion.kt similarity index 82% rename from compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.kt rename to compiler/testData/diagnostics/propertyClassFileDependencyRecursion.kt index 92a05929628..9833984a38d 100644 --- a/compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.kt +++ b/compiler/testData/diagnostics/propertyClassFileDependencyRecursion.kt @@ -4,7 +4,7 @@ package test import other.prop // Note: "prop" is expected to be unresolved and replaced to Any -class PropType: prop +class PropType: prop // Note: this time "prop" should be resolved and type should be inferred for "checkTypeProp" val checkTypeProp = prop @@ -14,4 +14,4 @@ package other import test.PropType -val prop: PropType? = null +val prop: PropType? = null \ No newline at end of file diff --git a/compiler/testData/diagnostics/propertyClassFileDependencyRecursion.txt b/compiler/testData/diagnostics/propertyClassFileDependencyRecursion.txt new file mode 100644 index 00000000000..ab20e809783 --- /dev/null +++ b/compiler/testData/diagnostics/propertyClassFileDependencyRecursion.txt @@ -0,0 +1,16 @@ +package + +package other { + internal val prop: test.PropType? = null +} + +package test { + internal val checkTypeProp: test.PropType? = null + + internal final class PropType { + public constructor PropType() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/sameClassNameResolve.kt b/compiler/testData/diagnostics/sameClassNameResolve.kt similarity index 100% rename from compiler/testData/lazyResolve/recursiveComparator/sameClassNameResolve.kt rename to compiler/testData/diagnostics/sameClassNameResolve.kt diff --git a/compiler/testData/diagnostics/sameClassNameResolve.txt b/compiler/testData/diagnostics/sameClassNameResolve.txt new file mode 100644 index 00000000000..41e6cf2a150 --- /dev/null +++ b/compiler/testData/diagnostics/sameClassNameResolve.txt @@ -0,0 +1,32 @@ +package + +internal open class Base { + public constructor Base() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +internal final class SubBase : Base { + public constructor SubBase() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +package test { + + internal open class Base { + public constructor Base() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + internal final class SubBase : test.Base { + public constructor SubBase() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/simpleClass.kt b/compiler/testData/diagnostics/simpleClass.kt new file mode 100644 index 00000000000..2781feefe37 --- /dev/null +++ b/compiler/testData/diagnostics/simpleClass.kt @@ -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 {open fun f(): T {} fun a() {}} + +// FILE: d.kt +package test.p; class G2 : G { 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) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/simpleClass.txt b/compiler/testData/diagnostics/simpleClass.txt new file mode 100644 index 00000000000..52f61c94346 --- /dev/null +++ b/compiler/testData/diagnostics/simpleClass.txt @@ -0,0 +1,43 @@ +package + +package test { + + internal final class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + package test.p { + internal fun foo(): kotlin.Unit + internal fun foo(/*0*/ a: test.p.C): kotlin.Unit + + internal final class C { + public constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal final fun f(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + internal open class G { + public constructor G() + internal final fun a(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal open fun f(): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + internal final class G2 : test.p.G { + public constructor G2() + internal final override /*1*/ /*fake_override*/ fun a(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal open override /*1*/ fun f(): E + internal final fun g(): E + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/AnnotationOnObject.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt similarity index 100% rename from compiler/testData/lazyResolve/recursiveComparator/AnnotationOnObject.kt rename to compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.txt b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.txt new file mode 100644 index 00000000000..b42053a88c3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.txt @@ -0,0 +1,28 @@ +package + +package test { + + internal final annotation class A : kotlin.Annotation { + public constructor A(/*0*/ a: kotlin.Int = ..., /*1*/ b: kotlin.String = ..., /*2*/ c: kotlin.String) + internal final val a: kotlin.Int + internal final val b: kotlin.String + internal final val c: kotlin.String + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + test.A(a = IntegerValueType(12): IntegerValueType(12), c = "Hello": kotlin.String) internal object SomeObject { + private constructor SomeObject() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public class object : test.SomeObject { + private constructor () + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.kt b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt similarity index 79% rename from compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.kt rename to compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt index 5652c10b9fe..9328179c44d 100644 --- a/compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt @@ -3,7 +3,7 @@ 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 +BadAnnotation object SomeObject -val some = SomeObject +val some = SomeObject \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.txt b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.txt new file mode 100644 index 00000000000..9f3ec0643f7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.txt @@ -0,0 +1,19 @@ +package + +package test { + internal val some: test.SomeObject + + [ERROR : BadAnnotation]() internal object SomeObject { + private constructor SomeObject() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public class object : test.SomeObject { + private constructor () + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt b/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt new file mode 100644 index 00000000000..994539b7681 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt @@ -0,0 +1,8 @@ +package test + +BadAnnotation(1) +object SomeObject + +val some = SomeObject + +annotation class BadAnnotation(val s: String) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.txt b/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.txt new file mode 100644 index 00000000000..f09544b082e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.txt @@ -0,0 +1,27 @@ +package + +package test { + internal val some: test.SomeObject + + internal final annotation class BadAnnotation : kotlin.Annotation { + public constructor BadAnnotation(/*0*/ s: kotlin.String) + internal final val s: kotlin.String + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + test.BadAnnotation(s = IntegerValueType(1): IntegerValueType(1)) internal object SomeObject { + private constructor SomeObject() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public class object : test.SomeObject { + private constructor () + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } +} diff --git a/compiler/testData/diagnostics/tests/classObjects/classObjectHeader.kt b/compiler/testData/diagnostics/tests/classObjects/classObjectHeader.kt new file mode 100644 index 00000000000..373561d74eb --- /dev/null +++ b/compiler/testData/diagnostics/tests/classObjects/classObjectHeader.kt @@ -0,0 +1,9 @@ +package test + +open class ToResolve(f : (Int) -> Int) +fun testFun(a : Int) = 12 + +class TestSome

{ + class object : ToResolve<P>({testFun(it)}) { + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classObjects/classObjectHeader.txt b/compiler/testData/diagnostics/tests/classObjects/classObjectHeader.txt new file mode 100644 index 00000000000..4c99fc4711e --- /dev/null +++ b/compiler/testData/diagnostics/tests/classObjects/classObjectHeader.txt @@ -0,0 +1,26 @@ +package + +package test { + internal fun testFun(/*0*/ a: kotlin.Int): kotlin.Int + + internal final class TestSome { + public constructor TestSome() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + internal class object : test.ToResolve

{ + private constructor () + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } + + internal open class ToResolve { + public constructor ToResolve(/*0*/ f: (kotlin.Int) -> kotlin.Int) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt b/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt new file mode 100644 index 00000000000..3da729eb2f7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt @@ -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 + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.txt b/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.txt new file mode 100644 index 00000000000..fc2d3a9e327 --- /dev/null +++ b/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.txt @@ -0,0 +1,20 @@ +package + +package test { + + internal final class Test { + public constructor Test() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal final fun test(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + internal class object { + private constructor () + internal final val a: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/fileDependencyRecursion.kt b/compiler/testData/diagnostics/tests/fileDependencyRecursion.kt similarity index 100% rename from compiler/testData/lazyResolve/recursiveComparator/fileDependencyRecursion.kt rename to compiler/testData/diagnostics/tests/fileDependencyRecursion.kt diff --git a/compiler/testData/diagnostics/tests/fileDependencyRecursion.txt b/compiler/testData/diagnostics/tests/fileDependencyRecursion.txt new file mode 100644 index 00000000000..0c88600426b --- /dev/null +++ b/compiler/testData/diagnostics/tests/fileDependencyRecursion.txt @@ -0,0 +1,11 @@ +package + +package test { + internal val fromImported: kotlin.Int = 1 + internal val normal: kotlin.Int = 1 +} + +package testOther { + internal val fromImported: kotlin.Int = 1 + internal val some: kotlin.Int = 1 +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImport.kt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.kt similarity index 100% rename from compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImport.kt rename to compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.kt diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.txt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.txt new file mode 100644 index 00000000000..9b88c8837f2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.txt @@ -0,0 +1,23 @@ +package + +package test { + internal val inferTypeFromImportedFun: kotlin.Int + + internal final class B : testOther.A { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +package testOther { + internal fun testFun(): kotlin.Int + + internal open class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.kt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt similarity index 89% rename from compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.kt rename to compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt index cf512690411..24f772375d1 100644 --- a/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.kt +++ b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt @@ -6,7 +6,7 @@ import testing.other.* import testing.TestFun // Resolve should be ambiguous -val a = TestFun() +val a = TestFun() //FILE:testing.kt diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt new file mode 100644 index 00000000000..bedd9fddc6f --- /dev/null +++ b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt @@ -0,0 +1,19 @@ +package + +package test { + internal val a: [ERROR : Type for TestFun()] +} + +package testing { + + internal final class TestFun { + public constructor TestFun() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + package testing.other { + internal fun TestFun(): kotlin.Int + } +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.kt b/compiler/testData/diagnostics/tests/inner/InnerClassNameClash.kt similarity index 61% rename from compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.kt rename to compiler/testData/diagnostics/tests/inner/InnerClassNameClash.kt index 89bb533a588..6c9e33d1f0a 100644 --- a/compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.kt +++ b/compiler/testData/diagnostics/tests/inner/InnerClassNameClash.kt @@ -2,9 +2,9 @@ package test class B { class B { - fun foo(b: B.C) { + fun foo(b: B.C) { } class C { } } -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/InnerClassNameClash.txt b/compiler/testData/diagnostics/tests/inner/InnerClassNameClash.txt new file mode 100644 index 00000000000..9db4ad3a169 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inner/InnerClassNameClash.txt @@ -0,0 +1,26 @@ +package + +package test { + + internal final class B { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + internal final class B { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal final fun foo(/*0*/ b: test.B.B.C): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + internal final class C { + public constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } + } +} diff --git a/compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt b/compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt new file mode 100644 index 00000000000..10da9b959bf --- /dev/null +++ b/compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt @@ -0,0 +1,9 @@ +package test + +open class A { + open fun foo(a: E) {} +} + +class B : A() { + override fun foo(a: E) {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/OverrideWithErrors.txt b/compiler/testData/diagnostics/tests/override/OverrideWithErrors.txt new file mode 100644 index 00000000000..5607dfcb1f9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/override/OverrideWithErrors.txt @@ -0,0 +1,20 @@ +package + +package test { + + internal open class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal open fun foo(/*0*/ a: [ERROR : E]): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + internal final class B : test.A { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal open override /*1*/ fun foo(/*0*/ a: [ERROR : E]): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/varargs/varargIterator.kt b/compiler/testData/diagnostics/tests/varargs/varargIterator.kt new file mode 100644 index 00000000000..e67987bbf90 --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/varargIterator.kt @@ -0,0 +1,5 @@ +package test + +class CompositeIterator(vararg iterators: java.util.Iterator){ + val iteratorsIter = iterators.iterator() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/varargIterator.txt b/compiler/testData/diagnostics/tests/varargs/varargIterator.txt new file mode 100644 index 00000000000..94e926dd2e7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/varargIterator.txt @@ -0,0 +1,12 @@ +package + +package test { + + internal final class CompositeIterator { + public constructor CompositeIterator(/*0*/ vararg iterators: java.util.Iterator /*kotlin.Array>*/) + internal final val iteratorsIter: kotlin.Iterator> + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/lazyResolve/recursiveComparator/AnnotationOnObject.txt b/compiler/testData/lazyResolve/recursiveComparator/AnnotationOnObject.txt deleted file mode 100644 index 595cd08d68f..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/AnnotationOnObject.txt +++ /dev/null @@ -1,19 +0,0 @@ -package test - -internal final annotation class A : kotlin.Annotation { - /*primary*/ public constructor A(/*0*/ a: kotlin.Int = ..., /*1*/ b: kotlin.String = ..., /*2*/ c: kotlin.String) - internal final val a: kotlin.Int - internal final fun (): kotlin.Int - internal final val b: kotlin.String - internal final fun (): kotlin.String - internal final val c: kotlin.String - internal final fun (): kotlin.String -} - -test.A(a = IntegerValueType(12): IntegerValueType(12), c = "Hello": kotlin.String) internal object SomeObject { - /*primary*/ private constructor SomeObject() - - public class object : test.SomeObject { - /*primary*/ private constructor () - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.kt b/compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.kt deleted file mode 100644 index 9a060d9a1e7..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.kt +++ /dev/null @@ -1,10 +0,0 @@ -package test - -trait A -trait B : A, E -trait C : B -trait D : B -trait E : F -trait F : D, C -trait G : F -trait H : F \ No newline at end of file diff --git a/compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.txt b/compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.txt deleted file mode 100644 index 2b5136f8c42..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.txt +++ /dev/null @@ -1,25 +0,0 @@ -package test - -internal trait A { -} - -internal trait B : test.A { -} - -internal trait C { -} - -internal trait D { -} - -internal trait E { -} - -internal trait F { -} - -internal trait G : test.F { -} - -internal trait H : test.F { -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.txt b/compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.txt deleted file mode 100644 index 3b344fb33e0..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.txt +++ /dev/null @@ -1,14 +0,0 @@ -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): kotlin.Unit - - internal final class C { - /*primary*/ public constructor C() - } - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.kt b/compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.kt deleted file mode 100644 index b5901668988..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.kt +++ /dev/null @@ -1,9 +0,0 @@ -package test - -open class A { - open fun foo(a: E) {} -} - -class B : A() { - override fun foo(a: E) {} -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.txt b/compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.txt deleted file mode 100644 index 9ae8e1e735d..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.txt +++ /dev/null @@ -1,11 +0,0 @@ -package test - -internal open class A { - /*primary*/ public constructor A() - internal open fun foo(/*0*/ a: [ERROR : E]): kotlin.Unit -} - -internal final class B : test.A { - /*primary*/ public constructor B() - internal open override /*1*/ fun foo(/*0*/ a: [ERROR : E]): kotlin.Unit -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.txt b/compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.txt deleted file mode 100644 index aa1f539d4d1..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.txt +++ /dev/null @@ -1,12 +0,0 @@ -package test - -internal val some: test.SomeObject - internal fun (): test.SomeObject - -[ERROR : BadAnnotation]() internal object SomeObject { - /*primary*/ private constructor SomeObject() - - public class object : test.SomeObject { - /*primary*/ private constructor () - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.kt b/compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.kt deleted file mode 100644 index 99e48c45ca6..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.kt +++ /dev/null @@ -1,8 +0,0 @@ -package test - -BadAnnotation(1) -object SomeObject - -val some = SomeObject - -annotation class BadAnnotation(val s: String) diff --git a/compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.txt b/compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.txt deleted file mode 100644 index b41d41c9ec3..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.txt +++ /dev/null @@ -1,18 +0,0 @@ -package test - -internal val some: test.SomeObject - internal fun (): test.SomeObject - -internal final annotation class BadAnnotation : kotlin.Annotation { - /*primary*/ public constructor BadAnnotation(/*0*/ s: kotlin.String) - internal final val s: kotlin.String - internal final fun (): kotlin.String -} - -test.BadAnnotation(s = IntegerValueType(1): IntegerValueType(1)) internal object SomeObject { - /*primary*/ private constructor SomeObject() - - public class object : test.SomeObject { - /*primary*/ private constructor () - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.kt b/compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.kt deleted file mode 100644 index 5c4e3ba9d25..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.kt +++ /dev/null @@ -1,9 +0,0 @@ -package test - -open class ToResolve(f : (Int) -> Int) -fun testFun(a : Int) = 12 - -class TestSome

{ - class object : ToResolve

({testFun(it)}) { - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.txt b/compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.txt deleted file mode 100644 index 8c6f0d9fe9e..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.txt +++ /dev/null @@ -1,15 +0,0 @@ -package test - -internal fun testFun(/*0*/ a: kotlin.Int): kotlin.Int - -internal final class TestSome { - /*primary*/ public constructor TestSome() - - internal class object : test.ToResolve

{ - /*primary*/ private constructor () - } -} - -internal open class ToResolve { - /*primary*/ public constructor ToResolve(/*0*/ f: (kotlin.Int) -> kotlin.Int) -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/fileDependencyRecursion.txt b/compiler/testData/lazyResolve/recursiveComparator/fileDependencyRecursion.txt deleted file mode 100644 index 04f3e36c5a8..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/fileDependencyRecursion.txt +++ /dev/null @@ -1,6 +0,0 @@ -package test - -internal val fromImported: kotlin.Int = 1 - internal fun (): kotlin.Int -internal val normal: kotlin.Int = 1 - internal fun (): kotlin.Int diff --git a/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImport.txt b/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImport.txt deleted file mode 100644 index 81556426d80..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImport.txt +++ /dev/null @@ -1,8 +0,0 @@ -package test - -internal val inferTypeFromImportedFun: kotlin.Int - internal fun (): kotlin.Int - -internal final class B : testOther.A { - /*primary*/ public constructor B() -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.txt b/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.txt deleted file mode 100644 index 319a27e9212..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.txt +++ /dev/null @@ -1,4 +0,0 @@ -package test - -internal val a: [ERROR : Type for TestFun()] - internal fun (): [ERROR : Type for TestFun()] diff --git a/compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.txt b/compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.txt deleted file mode 100644 index 3c017ccf85f..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.txt +++ /dev/null @@ -1,8 +0,0 @@ -package test - -internal val checkTypeProp: test.PropType? = null - internal fun (): test.PropType? - -internal final class PropType { - /*primary*/ public constructor PropType() -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.kt b/compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.kt deleted file mode 100644 index 0befa69be87..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.kt +++ /dev/null @@ -1,9 +0,0 @@ -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 - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.txt b/compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.txt deleted file mode 100644 index 8172e8a20d8..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.txt +++ /dev/null @@ -1,12 +0,0 @@ -package test - -internal final class Test { - /*primary*/ public constructor Test() - internal final fun test(): kotlin.Int - - internal class object { - /*primary*/ private constructor () - internal final val a: kotlin.Int - internal final fun (): kotlin.Int - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/sameClassNameResolve.txt b/compiler/testData/lazyResolve/recursiveComparator/sameClassNameResolve.txt deleted file mode 100644 index e405b9bfa21..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/sameClassNameResolve.txt +++ /dev/null @@ -1,9 +0,0 @@ -package test - -internal open class Base { - /*primary*/ public constructor Base() -} - -internal final class SubBase : test.Base { - /*primary*/ public constructor SubBase() -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/simpleClass.kt b/compiler/testData/lazyResolve/recursiveComparator/simpleClass.kt deleted file mode 100644 index f8065d9a914..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/simpleClass.kt +++ /dev/null @@ -1,19 +0,0 @@ -// 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 {open fun f(): T {} fun a() {}} - -// FILE: d.kt -package test.p; class G2 : G { 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) {} diff --git a/compiler/testData/lazyResolve/recursiveComparator/simpleClass.txt b/compiler/testData/lazyResolve/recursiveComparator/simpleClass.txt deleted file mode 100644 index 4e076bfedd4..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/simpleClass.txt +++ /dev/null @@ -1,28 +0,0 @@ -package test - -internal final class A { - /*primary*/ public constructor A() -} - -package test.p { - internal fun foo(): kotlin.Unit - internal fun foo(/*0*/ a: test.p.C): kotlin.Unit - - internal final class C { - /*primary*/ public constructor C() - internal final fun f(): kotlin.Unit - } - - internal open class G { - /*primary*/ public constructor G() - internal final fun a(): kotlin.Unit - internal open fun f(): T - } - - internal final class G2 : test.p.G { - /*primary*/ public constructor G2() - internal final override /*1*/ /*fake_override*/ fun a(): kotlin.Unit - internal open override /*1*/ fun f(): E - internal final fun g(): E - } -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/varargIterator.kt b/compiler/testData/lazyResolve/recursiveComparator/varargIterator.kt deleted file mode 100644 index 6a70c934eac..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/varargIterator.kt +++ /dev/null @@ -1,5 +0,0 @@ -package test - -class CompositeIterator(vararg iterators: java.util.Iterator){ - val iteratorsIter = iterators.iterator() -} diff --git a/compiler/testData/lazyResolve/recursiveComparator/varargIterator.txt b/compiler/testData/lazyResolve/recursiveComparator/varargIterator.txt deleted file mode 100644 index 767a03025d4..00000000000 --- a/compiler/testData/lazyResolve/recursiveComparator/varargIterator.txt +++ /dev/null @@ -1,7 +0,0 @@ -package test - -internal final class CompositeIterator { - /*primary*/ public constructor CompositeIterator(/*0*/ vararg iterators: java.util.Iterator /*kotlin.Array>*/) - internal final val iteratorsIter: kotlin.Iterator> - internal final fun (): kotlin.Iterator> -} diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index d8ffbfbcd85..6438ef7fce1 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -196,6 +196,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("fileDependencyRecursion.kt") + public void testFileDependencyRecursion() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/fileDependencyRecursion.kt"); + doTest(fileName); + } + @TestMetadata("FinalClassObjectBound.kt") public void testFinalClassObjectBound() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/FinalClassObjectBound.kt"); @@ -589,6 +595,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("AnnotationOnObject.kt") + public void testAnnotationOnObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt"); + doTest(fileName); + } + @TestMetadata("AnnotationsForClasses.kt") public void testAnnotationsForClasses() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.kt"); @@ -697,6 +709,18 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("UnresolvedAnnotationOnObject.kt") + public void testUnresolvedAnnotationOnObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt"); + doTest(fileName); + } + + @TestMetadata("WrongAnnotationArgsOnObject.kt") + public void testWrongAnnotationArgsOnObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt"); + doTest(fileName); + } + @TestMetadata("compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1361,6 +1385,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("classObjectHeader.kt") + public void testClassObjectHeader() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/classObjects/classObjectHeader.kt"); + doTest(fileName); + } + @TestMetadata("classObjectInLocalClass.kt") public void testClassObjectInLocalClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/classObjects/classObjectInLocalClass.kt"); @@ -1408,6 +1438,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/classObjects/nestedClassInPrivateClassObject.kt"); doTest(fileName); } + + @TestMetadata("resolveFunctionInsideClassObject.kt") + public void testResolveFunctionInsideClassObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/diagnostics/tests/controlFlowAnalysis") @@ -4607,6 +4643,18 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/imports"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("importFunctionWithAllUnderImport.kt") + public void testImportFunctionWithAllUnderImport() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.kt"); + doTest(fileName); + } + + @TestMetadata("importFunctionWithAllUnderImportAfterNamedImport.kt") + public void testImportFunctionWithAllUnderImportAfterNamedImport() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt"); + doTest(fileName); + } + @TestMetadata("ImportResolutionOrder.kt") public void testImportResolutionOrder() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.kt"); @@ -6033,6 +6081,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("InnerClassNameClash.kt") + public void testInnerClassNameClash() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inner/InnerClassNameClash.kt"); + doTest(fileName); + } + @TestMetadata("innerClassesInStaticParameters.kt") public void testInnerClassesInStaticParameters() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inner/innerClassesInStaticParameters.kt"); @@ -7734,6 +7788,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("OverrideWithErrors.kt") + public void testOverrideWithErrors() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt"); + doTest(fileName); + } + @TestMetadata("OverridingFinalMember.kt") public void testOverridingFinalMember() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/OverridingFinalMember.kt"); @@ -10211,6 +10271,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("varargIterator.kt") + public void testVarargIterator() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/varargs/varargIterator.kt"); + doTest(fileName); + } + @TestMetadata("varargsAndFunctionLiterals.kt") public void testVarargsAndFunctionLiterals() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/varargs/varargsAndFunctionLiterals.kt"); diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveRecursiveComparingTest.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveRecursiveComparingTest.java deleted file mode 100644 index 7fa77f84315..00000000000 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveRecursiveComparingTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lang.resolve.lazy; - -import com.intellij.openapi.util.io.FileUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.ConfigurationKind; -import org.jetbrains.jet.JetTestUtils; -import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment; -import org.jetbrains.jet.lang.descriptors.ModuleDescriptor; -import org.jetbrains.jet.lang.descriptors.PackageViewDescriptor; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.resolve.name.FqName; -import org.jetbrains.jet.test.util.RecursiveDescriptorComparator; -import org.junit.Assert; - -import java.io.File; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory; -import static org.jetbrains.jet.test.util.DescriptorValidator.ValidationVisitor.errorTypesAllowed; -import static org.jetbrains.jet.test.util.DescriptorValidator.ValidationVisitor.errorTypesForbidden; - -public abstract class AbstractLazyResolveRecursiveComparingTest extends KotlinTestWithEnvironment { - - @Override - protected JetCoreEnvironment createEnvironment() { - return createEnvironmentWithMockJdk(ConfigurationKind.ALL); - } - - protected void doTest(String testFileName) throws IOException { - doTest(testFileName, true, true, true); - } - - private void doTest(String testFileName, boolean checkPrimaryConstructors, boolean checkPropertyAccessors, boolean allowErrorTypes) throws IOException { - List files = JetTestUtils.createTestFiles( - testFileName, - FileUtil.loadFile(new File(testFileName), true), - new JetTestUtils.TestFileFactoryNoModules() { - @NotNull - @Override - public JetFile create(@NotNull String fileName, @NotNull String text, @NotNull Map directives) { - return JetPsiFactory(getProject()).createFile(fileName, text); - } - } - ); - - ModuleDescriptor module = LazyResolveTestUtil.resolve(files, getEnvironment()); - - String testedPackage = "test"; - PackageViewDescriptor testPackage = module.getPackage(new FqName(testedPackage)); - Assert.assertNotNull("Package for name '" + testedPackage + "' is null after resolve", testPackage); - - File serializeResultsTo = new File(FileUtil.getNameWithoutExtension(testFileName) + ".txt"); - - RecursiveDescriptorComparator.validateAndCompareDescriptorWithFile( - testPackage, RecursiveDescriptorComparator.DONT_INCLUDE_METHODS_OF_OBJECT - .filterRecursion(RecursiveDescriptorComparator.SKIP_BUILT_INS_PACKAGES) - .checkPrimaryConstructors(checkPrimaryConstructors) - .checkPropertyAccessors(checkPropertyAccessors) - .withValidationStrategy(allowErrorTypes ? errorTypesAllowed() : errorTypesForbidden()), - serializeResultsTo); - } -} diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveRecursiveComparingTestGenerated.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveRecursiveComparingTestGenerated.java deleted file mode 100644 index 68cc1f3820b..00000000000 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveRecursiveComparingTestGenerated.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2010-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lang.resolve.lazy; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.jet.JUnit3RunnerWithInners; -import org.jetbrains.jet.JetTestUtils; -import org.jetbrains.jet.test.InnerTestClasses; -import org.jetbrains.jet.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("compiler/testData/lazyResolve/recursiveComparator") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class LazyResolveRecursiveComparingTestGenerated extends AbstractLazyResolveRecursiveComparingTest { - public void testAllFilesPresentInRecursiveComparator() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/lazyResolve/recursiveComparator"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("AnnotationOnObject.kt") - public void testAnnotationOnObject() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/AnnotationOnObject.kt"); - doTest(fileName); - } - - @TestMetadata("classObjectHeader.kt") - public void testClassObjectHeader() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/classObjectHeader.kt"); - doTest(fileName); - } - - @TestMetadata("CyclicHierarchy.kt") - public void testCyclicHierarchy() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/CyclicHierarchy.kt"); - doTest(fileName); - } - - @TestMetadata("fileDependencyRecursion.kt") - public void testFileDependencyRecursion() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/fileDependencyRecursion.kt"); - doTest(fileName); - } - - @TestMetadata("importFunctionWithAllUnderImport.kt") - public void testImportFunctionWithAllUnderImport() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImport.kt"); - doTest(fileName); - } - - @TestMetadata("importFunctionWithAllUnderImportAfterNamedImport.kt") - public void testImportFunctionWithAllUnderImportAfterNamedImport() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/importFunctionWithAllUnderImportAfterNamedImport.kt"); - doTest(fileName); - } - - @TestMetadata("InnerClassNameClash.kt") - public void testInnerClassNameClash() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/InnerClassNameClash.kt"); - doTest(fileName); - } - - @TestMetadata("OverrideWithErrors.kt") - public void testOverrideWithErrors() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/OverrideWithErrors.kt"); - doTest(fileName); - } - - @TestMetadata("propertyClassFileDependencyRecursion.kt") - public void testPropertyClassFileDependencyRecursion() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/propertyClassFileDependencyRecursion.kt"); - doTest(fileName); - } - - @TestMetadata("resolveFunctionInsideClassObject.kt") - public void testResolveFunctionInsideClassObject() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/resolveFunctionInsideClassObject.kt"); - doTest(fileName); - } - - @TestMetadata("sameClassNameResolve.kt") - public void testSameClassNameResolve() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/sameClassNameResolve.kt"); - doTest(fileName); - } - - @TestMetadata("simpleClass.kt") - public void testSimpleClass() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/simpleClass.kt"); - doTest(fileName); - } - - @TestMetadata("UnresolvedAnnotationOnObject.kt") - public void testUnresolvedAnnotationOnObject() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/UnresolvedAnnotationOnObject.kt"); - doTest(fileName); - } - - @TestMetadata("varargIterator.kt") - public void testVarargIterator() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/varargIterator.kt"); - doTest(fileName); - } - - @TestMetadata("WrongAnnotationArgsOnObject.kt") - public void testWrongAnnotationArgsOnObject() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/lazyResolve/recursiveComparator/WrongAnnotationArgsOnObject.kt"); - doTest(fileName); - } -} diff --git a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt index deac42ec2cd..84a6fe9d568 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt @@ -35,7 +35,6 @@ import org.jetbrains.jet.codegen.defaultConstructor.AbstractDefaultArgumentsRefl import org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest import org.jetbrains.jet.jvm.compiler.AbstractCompileJavaAgainstKotlinTest import org.jetbrains.jet.jvm.compiler.AbstractCompileKotlinAgainstKotlinTest -import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveRecursiveComparingTest import org.jetbrains.jet.modules.xml.AbstractModuleXmlParserTest import org.jetbrains.jet.jvm.compiler.AbstractWriteSignatureTest import org.jetbrains.jet.cli.AbstractKotlincExecutableTest @@ -249,10 +248,6 @@ fun main(args: Array) { model("renderer") } - testClass(javaClass()) { - model("lazyResolve/recursiveComparator") - } - testClass(javaClass()) { model("modules.xml", extension = "xml") }