Tests for importing type aliases

This commit is contained in:
Dmitry Petrov
2016-06-07 12:14:40 +03:00
parent 4b6b35dadf
commit cb08d976d3
3 changed files with 53 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// FILE: file1.kt
package package1
typealias S = String
// FILE: file2.kt
package package2
typealias I = Int
class Outer {
typealias A = Any
}
// FILE: test.kt
package package3
import package1.*
import package2.I
import package2.Outer.A
val testS: S = ""
val testI: I = 42
val testA: A = Any()
@@ -0,0 +1,23 @@
package
package package1 {
public typealias S = kotlin.String
}
package package2 {
public typealias I = kotlin.Int
public final class Outer {
public typealias A = kotlin.Any
public constructor Outer()
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 package3 {
public val testA: package2.Outer.A [= kotlin.Any]
public val testI: package2.I [= kotlin.Int] = 42
public val testS: package1.S [= kotlin.String] = ""
}
@@ -19398,6 +19398,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("import.kt")
public void testImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/import.kt");
doTest(fileName);
}
@TestMetadata("inSupertypesList.kt")
public void testInSupertypesList() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/inSupertypesList.kt");