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: IFoo): Int {
  return 1
}

operator fun B.get(i: IFoo): Int {
  return 1
}

operator fun A.set(i: IFoo, newValue: Int) {
}

operator fun B.set(i: IFoo2, newValue: Int) {
}

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

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

fun test2() {
  { // BLOCK
    val tmp_2: B = B
    val tmp_3: Function1<Int, Unit> = { // BLOCK
      local fun withVararg(p0: Int) {
        withVararg(xs = [p0]) /*~> Unit */
      }

      ::withVararg
    }
    set(/* <this> = tmp_2, */ i = tmp_3 /*-> IFoo2 */, newValue = get(/* <this> = tmp_2, */ i = tmp_3 /*-> IFoo */).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 = tmp_5 /*-> IFoo */, newValue = get(/* <this> = tmp_4, */ i = tmp_5 /*-> IFoo */).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 = tmp_7 /*as IFoo */, newValue = get(/* <this> = tmp_6, */ i = tmp_7 /*as IFoo */).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 = tmp_9 /*-> IFoo */, newValue = get(/* <this> = tmp_8, */ i = tmp_9 /*-> IFoo */).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 = tmp_11 /*as IFoo */, newValue = get(/* <this> = tmp_10, */ i = tmp_11 /*as IFoo */).plus(other = 1))
  }
}

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

