typealias KR = KRunnable
typealias KSS = KSupplier<String>
typealias KCS = KConsumer<String>
fun interface KRunnable {
  abstract fun run()

}

fun interface KSupplier<T : Any?> {
  abstract fun get(): T

}

fun interface KConsumer<T : Any?> {
  abstract fun accept(x: T)

}

fun test1(): KFunction1<Function0<Unit>, KRunnable> {
  return { // BLOCK
    local fun KRunnable(function: Function0<Unit>): KRunnable {
      return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
    }

    ::KRunnable
  }
}

fun test1a(): KFunction1<Function0<Unit>, KRunnable> {
  return { // BLOCK
    local fun KRunnable(function: Function0<Unit>): KRunnable {
      return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
    }

    ::KRunnable
  }
}

fun test1b(): KFunction<KRunnable> {
  return { // BLOCK
    local fun KRunnable(function: Function0<Unit>): KRunnable {
      return CHECK_NOT_NULL<Function0<Unit>>(arg0 = function) /*-> KRunnable */
    }

    ::KRunnable
  }
}

fun test2(): Function1<Function0<String>, KSupplier<String>> {
  return { // BLOCK
    local fun KSupplier(function: Function0<String>): KSupplier<String> {
      return CHECK_NOT_NULL<Function0<String>>(arg0 = function) /*-> KSupplier<String> */
    }

    ::KSupplier
  }
}

fun test2a(): Function1<Function0<String>, KSupplier<String>> {
  return { // BLOCK
    local fun KSupplier(function: Function0<String>): KSupplier<String> {
      return CHECK_NOT_NULL<Function0<String>>(arg0 = function) /*-> KSupplier<String> */
    }

    ::KSupplier
  }
}

fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
  return { // BLOCK
    local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
      return CHECK_NOT_NULL<Function1<String, Unit>>(arg0 = function) /*-> KConsumer<String> */
    }

    ::KConsumer
  }
}

fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
  return { // BLOCK
    local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
      return CHECK_NOT_NULL<Function1<String, Unit>>(arg0 = function) /*-> KConsumer<String> */
    }

    ::KConsumer
  }
}

fun test3b(): KFunction<KConsumer<String>> {
  return { // BLOCK
    local fun KConsumer(function: Function1<String, Unit>): KConsumer<String> {
      return CHECK_NOT_NULL<Function1<String, Unit>>(arg0 = function) /*-> KConsumer<String> */
    }

    ::KConsumer
  }
}

