Tests added for checking two-phase (classes and functions) import resolution

This commit is contained in:
Nikolay Krasko
2012-12-28 18:26:54 +04:00
parent ee227f01b9
commit d4e3a4f74d
5 changed files with 54 additions and 0 deletions
@@ -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,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()
}
@@ -1952,6 +1952,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
doTestCheckingPrimaryConstructors("compiler/testData/lazyResolve/namespaceComparator/genericFunction.kt");
}
@TestMetadata("importFunctionWithAllUnderImport.kt")
public void testImportFunctionWithAllUnderImport() throws Exception {
doTestCheckingPrimaryConstructors("compiler/testData/lazyResolve/namespaceComparator/importFunctionWithAllUnderImport.kt");
}
@TestMetadata("importFunctionWithAllUnderImportAfterNamedImport.kt")
public void testImportFunctionWithAllUnderImportAfterNamedImport() throws Exception {
doTestCheckingPrimaryConstructors("compiler/testData/lazyResolve/namespaceComparator/importFunctionWithAllUnderImportAfterNamedImport.kt");
@@ -1982,6 +1987,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
doTestCheckingPrimaryConstructors("compiler/testData/lazyResolve/namespaceComparator/packageLevelObject.kt");
}
@TestMetadata("propertyClassFileDependencyRecursion.kt")
public void testPropertyClassFileDependencyRecursion() throws Exception {
doTestCheckingPrimaryConstructors("compiler/testData/lazyResolve/namespaceComparator/propertyClassFileDependencyRecursion.kt");
}
@TestMetadata("simpleClass.kt")
public void testSimpleClass() throws Exception {
doTestCheckingPrimaryConstructors("compiler/testData/lazyResolve/namespaceComparator/simpleClass.kt");