KT-11588 Type aliases

- Nested type aliases
- UNSUPPORTED_TYPEALIAS error (language level < 1.1)
- tests for is/as/as? with type alias
This commit is contained in:
Dmitry Petrov
2016-05-26 17:29:04 +03:00
parent e979300579
commit 0319d5a5aa
34 changed files with 493 additions and 133 deletions
@@ -0,0 +1,18 @@
//ALLOW_AST_ACCESS
package test
open class Pair<T1, T2>
open class Triple<T1, T2, T3>
class Outer<X> {
inner class InnerTest1<A>: Pair<X, A>()
typealias Test1<A> = Pair<X, A>
class Nested<Y> {
typealias Test2<B> = Pair<Y, B>
}
inner class Inner<Z> {
typealias Test3<C> = Triple<X, Z, C>
}
}
@@ -0,0 +1,28 @@
package test
public final class Outer</*0*/ X> {
public typealias Test1</*0*/ A> /*captured type parameters: /*1*/ X*/ = test.Pair<X, A>
/*primary*/ public constructor Outer</*0*/ X>()
public final inner class Inner</*0*/ Z> /*captured type parameters: /*1*/ X*/ {
public typealias Test3</*0*/ C> /*captured type parameters: /*1*/ Z, /*2*/ X*/ = test.Triple<X, Z, C>
/*primary*/ public constructor Inner</*0*/ Z>()
}
public final inner class InnerTest1</*0*/ A> /*captured type parameters: /*1*/ X*/ : test.Pair<X, A> {
/*primary*/ public constructor InnerTest1</*0*/ A>()
}
public final class Nested</*0*/ Y> {
public typealias Test2</*0*/ B> /*captured type parameters: /*1*/ Y*/ = test.Pair<Y, B>
/*primary*/ public constructor Nested</*0*/ Y>()
}
}
public open class Pair</*0*/ T1, /*1*/ T2> {
/*primary*/ public constructor Pair</*0*/ T1, /*1*/ T2>()
}
public open class Triple</*0*/ T1, /*1*/ T2, /*2*/ T3> {
/*primary*/ public constructor Triple</*0*/ T1, /*1*/ T2, /*2*/ T3>()
}