fun interface IFoo {
  abstract fun foo(i: Int)

}

fun interface IFoo2 : IFoo {
}

object A {
  private constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

}

object B {
  private constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

}

operator fun A.get(i: SuspendFunction1<Int, Unit>): Int {
  return 1
}

operator fun B.get(i: SuspendFunction1<Int, Unit>): Int {
  return 1
}

operator fun A.set(i: SuspendFunction1<Int, Unit>, newValue: Int) {
}

operator fun B.set(i: Function1<Int, Unit>, newValue: Int) {
}

fun test1() {
  { // BLOCK
    val tmp_0: A = A
    val tmp_1: SuspendFunction1<Int, Unit> = { // BLOCK
      local suspend fun withVararg(p0: Int) {
        withVararg(xs = [p0]) /*~> Unit */
      }

      ::withVararg
    }
    set(/* <this> = tmp_0, */ i = tmp_1, newValue = get(/* <this> = tmp_0, */ i = tmp_1).plus(other = 1))
  }
}

fun test2(fn: Function1<Int, Unit>) {
  { // BLOCK
    val tmp_2: B = B
    val tmp_3: Function1<Int, Unit> = fn
    set(/* <this> = tmp_2, */ i = tmp_3, newValue = get(/* <this> = tmp_2, */ i = { // BLOCK
      local suspend fun Function1<Int, Unit>.suspendConversion0(p0: Int) {
        $callee.invoke(p1 = p0)
      }

      ::suspendConversion0/*($callee = tmp_3) */
    }).plus(other = 1))
  }
}

fun test3(fn: Function1<Int, Unit>) {
  { // BLOCK
    val tmp_4: A = A
    val tmp_5: Function1<Int, Unit> = fn
    set(/* <this> = tmp_4, */ i = { // BLOCK
      local suspend fun Function1<Int, Unit>.suspendConversion0(p0: Int) {
        $callee.invoke(p1 = p0)
      }

      ::suspendConversion0/*($callee = tmp_5) */
    }, newValue = get(/* <this> = tmp_4, */ i = { // BLOCK
      local suspend fun Function1<Int, Unit>.suspendConversion1(p0: Int) {
        $callee.invoke(p1 = p0)
      }

      ::suspendConversion1/*($callee = tmp_5) */
    }).plus(other = 1))
  }
}

fun test4(fn: Function1<Int, Unit>) {
  when {
    fn is IFoo -> { // BLOCK
      val tmp_6: A = A
      val tmp_7: Any = fn
      set(/* <this> = tmp_6, */ i = { // BLOCK
        local suspend fun Function1<Int, Unit>.suspendConversion0(p0: Int) {
          $callee.invoke(p1 = p0)
        }

        ::suspendConversion0/*($callee = tmp_7) */
      }, newValue = get(/* <this> = tmp_6, */ i = { // BLOCK
        local suspend fun Function1<Int, Unit>.suspendConversion1(p0: Int) {
          $callee.invoke(p1 = p0)
        }

        ::suspendConversion1/*($callee = tmp_7) */
      }).plus(other = 1))
    }
  }
}

fun test5(a: Any) {
  a as Function1<Int, Unit> /*~> Unit */
  { // BLOCK
    val tmp_8: A = A
    val tmp_9: Function1<Int, Unit> = a /*as Function1<Int, Unit> */
    set(/* <this> = tmp_8, */ i = { // BLOCK
      local suspend fun Function1<Int, Unit>.suspendConversion0(p0: Int) {
        $callee.invoke(p1 = p0)
      }

      ::suspendConversion0/*($callee = tmp_9) */
    }, newValue = get(/* <this> = tmp_8, */ i = { // BLOCK
      local suspend fun Function1<Int, Unit>.suspendConversion1(p0: Int) {
        $callee.invoke(p1 = p0)
      }

      ::suspendConversion1/*($callee = tmp_9) */
    }).plus(other = 1))
  }
}

fun test6(a: Any) {
  a as Function1<Int, Unit> /*~> Unit */
  a /*as Function1<Int, Unit> */ as IFoo /*~> Unit */
  { // BLOCK
    val tmp_10: A = A
    val tmp_11: Any = a
    set(/* <this> = tmp_10, */ i = { // BLOCK
      local suspend fun Function1<Int, Unit>.suspendConversion0(p0: Int) {
        $callee.invoke(p1 = p0)
      }

      ::suspendConversion0/*($callee = tmp_11) */
    }, newValue = get(/* <this> = tmp_10, */ i = { // BLOCK
      local suspend fun Function1<Int, Unit>.suspendConversion1(p0: Int) {
        $callee.invoke(p1 = p0)
      }

      ::suspendConversion1/*($callee = tmp_11) */
    }).plus(other = 1))
  }
}

fun withVararg(vararg xs: Int): Int {
  return 42
}
