KT-11588 Type aliases

Additional tests for generic type alias arguments.
Small refactoring in TowerLevels.
This commit is contained in:
Dmitry Petrov
2016-05-25 15:38:45 +03:00
parent 62f8d00f89
commit 9cf8ef287e
6 changed files with 63 additions and 18 deletions
@@ -0,0 +1,10 @@
class C<T1, T2> {
companion object {
val OK = "OK"
}
}
typealias C2<T> = C<T, T>
val test1: String = <!FUNCTION_CALL_EXPECTED!>C2<String><!>.<!UNRESOLVED_REFERENCE!>OK<!>
val test2: String = C2.OK
@@ -0,0 +1,20 @@
package
public typealias C2</*0*/ T> = C<T, T>
public val test1: kotlin.String
public val test2: kotlin.String = "OK"
public final class C</*0*/ T1, /*1*/ T2> {
public constructor C</*0*/ T1, /*1*/ T2>()
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 companion object Companion {
private constructor Companion()
public final val OK: kotlin.String = "OK"
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
}
}
@@ -2,4 +2,10 @@ class Pair<T1, T2>(val x1: T1, val x2: T2)
typealias P2<T> = Pair<T, T>
val test1 = P2<String>("", "")
val test1: Pair<String, String> = P2<String>("", "")
val test1x1: String = test1.x1
val test1x2: String = test1.x2
val test2: P2<String> = P2<String>("", "")
val test2x1: String = test2.x1
val test2x2: String = test2.x2
@@ -2,6 +2,11 @@ package
public typealias P2</*0*/ T> = Pair<T, T>
public val test1: Pair<kotlin.String, kotlin.String>
public val test1x1: kotlin.String
public val test1x2: kotlin.String
public val test2: P2<kotlin.String> [= Pair<kotlin.String, kotlin.String>]
public val test2x1: kotlin.String
public val test2x2: kotlin.String
public final class Pair</*0*/ T1, /*1*/ T2> {
public constructor Pair</*0*/ T1, /*1*/ T2>(/*0*/ x1: T1, /*1*/ x2: T2)