open class Bar {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

  context($context-String: String)
  fun baz() {
  }

  context($context-String: String, b: Boolean)
  fun baz2() {
  }

}

class SubBar : Bar {
  constructor() /* primary */ {
    super/*Bar*/()
    /* <init>() */

  }

}

context($context-String: String)
fun foo() {
}

context($context-String: String, b: Boolean)
fun foo2() {
}

context($context-String: String)
suspend fun fooSuspend() {
  KSuspendFunction0<Unit>(
    /* bound = */ [$context-String],
    /* invoke = */    local suspend fun(c0: String) {
      fooSuspend(/* $context-String = c0 */)
    }
  )
 /*~> Unit */
}

context($context-String: String)
fun Int.qux() {
}

context($context-String: String, b: Boolean)
fun Int.qux2() {
}

fun String.test() {
  KFunction0<Unit>(
    /* bound = */ [<this>],
    /* invoke = */    local fun(c0: String) {
      foo(/* $context-String = c0 */)
    }
  )
 /*~> Unit */
  KFunction1<Bar, Unit>(
    /* bound = */ [<this>],
    /* invoke = */    local fun(c0: String, p0: Bar) {
      p0.baz(/* $context-String = c0 */)
    }
  )
 /*~> Unit */
  KFunction0<Unit>(
    /* bound = */ [<this>,Bar()],
    /* invoke = */    local fun(c0: String, receiver: Bar) {
      receiver.baz(/* $context-String = c0 */)
    }
  )
 /*~> Unit */
  KFunction1<SubBar, Unit>(
    /* bound = */ [<this>],
    /* invoke = */    local fun(c0: String, p0: SubBar) {
      p0.baz(/* $context-String = c0 */)
    }
  )
 /*~> Unit */
  KFunction0<Unit>(
    /* bound = */ [<this>,SubBar()],
    /* invoke = */    local fun(c0: String, receiver: SubBar) {
      receiver.baz(/* $context-String = c0 */)
    }
  )
 /*~> Unit */
  @ExtensionFunctionType KFunction1<Int, Unit>(
    /* bound = */ [<this>],
    /* invoke = */    local fun(c0: String, p0: Int) {
      qux(/* $context-String = c0, <this> = p0 */)
    }
  )
 /*~> Unit */
  KFunction0<Unit>(
    /* bound = */ [<this>,1],
    /* invoke = */    local fun(c0: String, receiver: Int) {
      qux(/* $context-String = c0, <this> = receiver */)
    }
  )
 /*~> Unit */
}

context(s: String, bb: Boolean)
fun test2() {
  KFunction0<Unit>(
    /* bound = */ [s,bb],
    /* invoke = */    local fun(c0: String, c1: Boolean) {
      foo2(/* $context-String = c0, b = c1 */)
    }
  )
 /*~> Unit */
  KFunction1<Bar, Unit>(
    /* bound = */ [s,bb],
    /* invoke = */    local fun(c0: String, c1: Boolean, p0: Bar) {
      p0.baz2(/* $context-String = c0, b = c1 */)
    }
  )
 /*~> Unit */
  KFunction0<Unit>(
    /* bound = */ [s,bb,Bar()],
    /* invoke = */    local fun(c0: String, c1: Boolean, receiver: Bar) {
      receiver.baz2(/* $context-String = c0, b = c1 */)
    }
  )
 /*~> Unit */
  KFunction1<SubBar, Unit>(
    /* bound = */ [s,bb],
    /* invoke = */    local fun(c0: String, c1: Boolean, p0: SubBar) {
      p0.baz2(/* $context-String = c0, b = c1 */)
    }
  )
 /*~> Unit */
  KFunction0<Unit>(
    /* bound = */ [s,bb,SubBar()],
    /* invoke = */    local fun(c0: String, c1: Boolean, receiver: SubBar) {
      receiver.baz2(/* $context-String = c0, b = c1 */)
    }
  )
 /*~> Unit */
  @ExtensionFunctionType KFunction1<Int, Unit>(
    /* bound = */ [s,bb],
    /* invoke = */    local fun(c0: String, c1: Boolean, p0: Int) {
      qux2(/* $context-String = c0, b = c1, <this> = p0 */)
    }
  )
 /*~> Unit */
  KFunction0<Unit>(
    /* bound = */ [s,bb,1],
    /* invoke = */    local fun(c0: String, c1: Boolean, receiver: Int) {
      qux2(/* $context-String = c0, b = c1, <this> = receiver */)
    }
  )
 /*~> Unit */
}

