[IR] Add irText test for generic annotations

This commit is contained in:
Roman Artemev
2021-03-10 17:38:32 +03:00
parent 79935e29de
commit 607a598f1a
7 changed files with 613 additions and 0 deletions
@@ -0,0 +1,78 @@
package ann
annotation class Test1<T : Any?> : Annotation {
constructor(x: Int) /* primary */
val x: Int
field = x
get
}
annotation class Test2<T1 : Any, T2 : Any?> : Annotation {
constructor(x: Int = 0) /* primary */
val x: Int
field = x
get
}
interface I<T : Any?> {
}
annotation class Test3<T1 : Any?, T2 : I<T1>> : Annotation {
constructor(x: Test1<I<T2>>) /* primary */
val x: Test1<I<T2>>
field = x
get
}
class C<T : Any?> : I<T> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
annotation class Test4 : Annotation {
constructor(x: Array<Test3<Int, C<Int>>>) /* primary */
val x: Array<Test3<Int, C<Int>>>
field = x
get
}
class ARG {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
annotation class Test5<T : Any?> : Annotation {
constructor(vararg xs: Test3<T, C<T>>) /* primary */
val xs: Array<out Test3<T, C<T>>>
field = xs
get
}
@Test1<ARG>(x = 42)
@Test2<String, String>(x = 38)
@Test3<String, C<String>>(x = Test1<I<C<String>>>(x = 39))
@Test4(x = [Test3<Int, C<Int>>(x = Test1<I<C<Int>>>(x = 40)), Test3<Int, C<Int>>(x = Test1<I<C<Int>>>(x = 50)), Test3<Int, C<Int>>(x = Test1<I<C<Int>>>(x = 60))])
@Test5<ARG>(xs = [[Test3<ARG, C<ARG>>(x = Test1<I<C<ARG>>>(x = 70))], [Test3<ARG, C<ARG>>(x = Test1<I<C<ARG>>>(x = 80))]])
class CC {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}