[IR] dumpKotlinLike: add testdata for FIR tests

This commit is contained in:
Zalim Bashorov
2020-11-20 18:18:14 +03:00
committed by teamcityserver
parent d7bd4240e1
commit c68040753d
298 changed files with 12186 additions and 0 deletions
@@ -0,0 +1,9 @@
fun <K1 : Any?, V1 : Any?> Map<out K1, V1>.plus(pair: Pair<K1, V1>): Map<K1, V1> {
return when {
<this>.isEmpty() -> mapOf<K1, V1>(pair = pair)
else -> LinkedHashMap<K1?, V1?>(p0 = <this>).apply<LinkedHashMap<K1?, V1?>>(block = local fun LinkedHashMap<K1?, V1?>.<anonymous>() {
return <this>.put(p0 = pair.<get-first>(), p1 = pair.<get-second>()) /*~> Unit */
}
)
}
}
@@ -0,0 +1,21 @@
abstract class Base<T : Any?> {
constructor(x: T) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: T
field = x
get
abstract fun <Y : Any?> foo(y: Y): T
abstract var bar: T
abstract get
abstract set
abstract var <Z : Any?> Z.exn: T
abstract get
abstract set
}
@@ -0,0 +1,24 @@
class Derived1<T : Any?> : Base<T> {
constructor(x: T) /* primary */ {
super/*Base*/<T>(x = x)
/* <init>() */
}
override fun <Y : Any?> foo(y: Y): T {
return <this>.<get-x>()
}
override var bar: T
field = x
override get
override set
override var <Z : Any?> Z.exn: T
override get(): T {
return <this>.<get-x>()
}
override set(value: T) {
}
}
@@ -0,0 +1,15 @@
fun test1(): J1<Int?> {
return J1<Int?>()
}
fun test2(): J1<Int?> {
return J1<Int?, Int?>(x1 = 1)
}
fun test3(j1: J1<Any>): J2<Int?, Any> {
return j1.J2<Int?>()
}
fun test4(j1: J1<Any>): J2<Int?, Any> {
return j1.J2<Int?, Int?>(x2 = 1)
}
+3
View File
@@ -0,0 +1,3 @@
val test: @FlexibleNullability JEnum
field = JEnum.ONE
get
@@ -0,0 +1,12 @@
class Test1 : J {
constructor() /* primary */ {
super/*J*/()
/* <init>() */
}
val test: JInner
field = <this>.JInner()
get
}
@@ -0,0 +1,3 @@
val test: String?
field = J().getFoo()
get
@@ -0,0 +1,4 @@
val Class<*>.test: Array<out Field?>?
get(): Array<out Field?>? {
return <this>.getDeclaredFields()
}