[IR] add testdata for dumpKotlinLike
This commit is contained in:
committed by
teamcityserver
parent
d2022ab115
commit
8d5facb15f
+117
@@ -0,0 +1,117 @@
|
||||
fun interface IFoo {
|
||||
abstract fun foo(i: Int)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun interface IFoo2 : IFoo {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
object A {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
object B {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
operator fun A.get(i: IFoo): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
operator fun A.set(i: IFoo, newValue: Int) {
|
||||
}
|
||||
|
||||
operator fun B.get(i: IFoo): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
operator fun B.set(i: IFoo2, newValue: Int) {
|
||||
}
|
||||
|
||||
fun withVararg(vararg xs: Int): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
fun test1() {
|
||||
{ //BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp2_sam: IFoo = local fun withVararg(p0: Int) {
|
||||
withVararg(xs = [p0]) /*~> Unit */
|
||||
}
|
||||
/*-> IFoo */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
{ //BLOCK
|
||||
val tmp0_array: B = B
|
||||
val tmp2_sam: IFoo2 = local fun withVararg(p0: Int) {
|
||||
withVararg(xs = [p0]) /*~> Unit */
|
||||
}
|
||||
/*-> IFoo2 */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
fun test3(fn: Function1<Int, Unit>) {
|
||||
{ //BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp2_sam: IFoo = fn /*-> IFoo */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
fun test4(fn: Function1<Int, Unit>) {
|
||||
when {
|
||||
fn is IFoo -> { //BLOCK
|
||||
{ //BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp1_index0: Function1<Int, Unit> = fn
|
||||
set($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */, newValue = get($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */).plus(other = 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun test5(a: Any) {
|
||||
a as Function1<Int, Unit> /*~> Unit */
|
||||
{ //BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp2_sam: IFoo = a /*as Function1<@ParameterName(...) Int, Unit> */ /*-> IFoo */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
fun test6(a: Any) {
|
||||
a as Function1<Int, Unit> /*~> Unit */
|
||||
a as IFoo /*~> Unit */
|
||||
{ //BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp1_index0: Any = a
|
||||
set($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */, newValue = get($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user