// FILE: annotations.kt
@file:Suppress(names = ["OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"])

@NativeCoroutines
@Deprecated(message = "This is deprecated 4")
val deprecatedProperty1: Flow<String>
  field = flowOf<String>(value = "OK4")
  get

@NativeCoroutines
@Deprecated(message = "This is deprecated 5", level = DeprecationLevel.WARNING)
val deprecatedProperty2: Flow<String>
  field = flowOf<String>(value = "OK5")
  get

@NativeCoroutines
@Deprecated(message = "This is deprecated 6", replaceWith = ReplaceWith(expression = "deprecatedProperty2", imports = []), level = DeprecationLevel.ERROR)
val deprecatedProperty3: Flow<String>
  field = flowOf<String>(value = "OK6")
  get

@NativeCoroutines
val deprecatedProperty4: MutableStateFlow<String>
  field = MutableStateFlow<String>(value = "OK7")
  @Deprecated(message = "This is deprecated 7")
  get

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameProperty1ObjC")
val objCNameProperty1: StateFlow<String>
  field = MutableStateFlow<String>(value = "OK11")
  get

@NativeCoroutinesState
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameProperty2ObjC")
val objCNameProperty2: StateFlow<String>
  field = MutableStateFlow<String>(value = "OK12")
  get

fun box(): String {
  return runBoxTest(action = local suspend fun BoxTest.<anonymous>() {
    $this$runBoxTest.await<String>(nativeSuspend = deprecatedFunction1Native())
    $this$runBoxTest.await<String>(nativeSuspend = deprecatedFunction2Native())
    $this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty1Native>())
    $this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty2Native>())
    $this$runBoxTest.collect<String>(nativeFlow = <get-deprecatedProperty4Native>(), maxValues = 1)
    $this$runBoxTest.value<String>(value = <get-deprecatedProperty4Value>())
    $this$runBoxTest.await<String>(nativeSuspend = objCNameFunction1Native())
    $this$runBoxTest.await<String>(nativeSuspend = objCNameFunction2Native())
    $this$runBoxTest.await<String>(nativeSuspend = objCNameFunction3Native())
    $this$runBoxTest.collect<String>(nativeFlow = <get-objCNameProperty1Native>(), maxValues = 1)
    $this$runBoxTest.value<String>(value = <get-objCNameProperty1Value>())
    $this$runBoxTest.collect<String>(nativeFlow = <get-objCNameProperty2Flow>(), maxValues = 1)
    $this$runBoxTest.value<String>(value = <get-objCNameProperty2Value>())
    $this$runBoxTest.await<String>(nativeSuspend = objCNameFunctionParameterNative(value = "OK13"))
  }
)
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 1")
suspend fun deprecatedFunction1(): String {
  return "OK1"
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 2", level = DeprecationLevel.WARNING)
suspend fun deprecatedFunction2(): String {
  return "OK2"
}

@NativeCoroutines
@Deprecated(message = "This is deprecated 3", replaceWith = ReplaceWith(expression = "deprecatedFunction2()", imports = []), level = DeprecationLevel.ERROR)
suspend fun deprecatedFunction3(): String {
  return "OK3"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameFunction1ObjC")
suspend fun objCNameFunction1(): String {
  return "OK8"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(, swiftName = "objCNameFunction2Swift")
suspend fun objCNameFunction2(): String {
  return "OK9"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
@ObjCName(name = "objCNameFunction3ObjC", swiftName = "objCNameFunction3Swift")
suspend fun objCNameFunction3(): String {
  return "OK10"
}

@NativeCoroutines
@OptIn(markerClass = [ExperimentalObjCName::class])
suspend fun objCNameFunctionParameter(@ObjCName(name = "valueObjC") value: String): String {
  return value
}

// FILE: __GENERATED DECLARATIONS__.kt

var deprecatedProperty4Value: String
  @Deprecated(message = "This is deprecated 7")
  get(): String {
    val tmp_0: MutableStateFlow<String> = <get-deprecatedProperty4>()
    return tmp_0.<get-value>()
  }
  @Deprecated(message = "This is deprecated 7")
  set(value: String) {
    return <get-deprecatedProperty4>().<set-value>(<set-?> = value)
  }

@Deprecated(message = "This is deprecated 1")
@ObjCName(name = "deprecatedFunction1")
fun deprecatedFunction1Native(): Function3<@ParameterName(name = "onResult") Function2<String, Unit, Unit>, @ParameterName(name = "onError") Function2<Throwable, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
  val tmp_1: CoroutineScope? = null
  return nativeSuspend<String>(scope = tmp_1, block = local suspend fun <anonymous>(): String {
    return deprecatedFunction1()
  }
)
}

@Deprecated(message = "This is deprecated 2", level = DeprecationLevel.WARNING)
@ObjCName(name = "deprecatedFunction2")
fun deprecatedFunction2Native(): Function3<@ParameterName(name = "onResult") Function2<String, Unit, Unit>, @ParameterName(name = "onError") Function2<Throwable, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
  val tmp_2: CoroutineScope? = null
  return nativeSuspend<String>(scope = tmp_2, block = local suspend fun <anonymous>(): String {
    return deprecatedFunction2()
  }
)
}

@Deprecated(message = "This is deprecated 3", level = DeprecationLevel.ERROR)
@ObjCName(name = "deprecatedFunction3")
fun deprecatedFunction3Native(): Function3<@ParameterName(name = "onResult") Function2<String, Unit, Unit>, @ParameterName(name = "onError") Function2<Throwable, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
  val tmp_3: CoroutineScope? = null
  return nativeSuspend<String>(scope = tmp_3, block = local suspend fun <anonymous>(): String {
    return deprecatedFunction3()
  }
)
}

@ObjCName(name = "objCNameFunction1ObjC")
fun objCNameFunction1Native(): Function3<@ParameterName(name = "onResult") Function2<String, Unit, Unit>, @ParameterName(name = "onError") Function2<Throwable, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
  val tmp_4: CoroutineScope? = null
  return nativeSuspend<String>(scope = tmp_4, block = local suspend fun <anonymous>(): String {
    return objCNameFunction1()
  }
)
}

@ObjCName(name = "objCNameFunction2", swiftName = "objCNameFunction2Swift")
fun objCNameFunction2Native(): Function3<@ParameterName(name = "onResult") Function2<String, Unit, Unit>, @ParameterName(name = "onError") Function2<Throwable, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
  val tmp_5: CoroutineScope? = null
  return nativeSuspend<String>(scope = tmp_5, block = local suspend fun <anonymous>(): String {
    return objCNameFunction2()
  }
)
}

@ObjCName(name = "objCNameFunction3ObjC", swiftName = "objCNameFunction3Swift")
fun objCNameFunction3Native(): Function3<@ParameterName(name = "onResult") Function2<String, Unit, Unit>, @ParameterName(name = "onError") Function2<Throwable, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
  val tmp_6: CoroutineScope? = null
  return nativeSuspend<String>(scope = tmp_6, block = local suspend fun <anonymous>(): String {
    return objCNameFunction3()
  }
)
}

@ObjCName(name = "objCNameFunctionParameter")
fun objCNameFunctionParameterNative(@ObjCName(name = "valueObjC") value: String): Function3<@ParameterName(name = "onResult") Function2<String, Unit, Unit>, @ParameterName(name = "onError") Function2<Throwable, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
  val tmp_7: CoroutineScope? = null
  return nativeSuspend<String>(scope = tmp_7, block = local suspend fun <anonymous>(): String {
    return objCNameFunctionParameter(value = value)
  }
)
}

@Deprecated(message = "This is deprecated 4")
@ObjCName(name = "deprecatedProperty1")
val deprecatedProperty1Native: Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>>
  get(): Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
    val tmp_8: CoroutineScope? = null
    val tmp_9: Flow<String> = <get-deprecatedProperty1>()
    return tmp_9.asNativeFlow<String>(scope = tmp_8)
  }

@Deprecated(message = "This is deprecated 5", level = DeprecationLevel.WARNING)
@ObjCName(name = "deprecatedProperty2")
val deprecatedProperty2Native: Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>>
  get(): Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
    val tmp_10: CoroutineScope? = null
    val tmp_11: Flow<String> = <get-deprecatedProperty2>()
    return tmp_11.asNativeFlow<String>(scope = tmp_10)
  }

@Deprecated(message = "This is deprecated 6", level = DeprecationLevel.ERROR)
@ObjCName(name = "deprecatedProperty3")
val deprecatedProperty3Native: Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>>
  get(): Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
    val tmp_12: CoroutineScope? = null
    val tmp_13: Flow<String> = <get-deprecatedProperty3>()
    return tmp_13.asNativeFlow<String>(scope = tmp_12)
  }

@ObjCName(name = "deprecatedProperty4")
val deprecatedProperty4Native: Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>>
  @Deprecated(message = "This is deprecated 7")
  get(): Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
    val tmp_14: CoroutineScope? = null
    val tmp_15: MutableStateFlow<String> = <get-deprecatedProperty4>()
    return tmp_15.asNativeFlow<String>(scope = tmp_14)
  }

@ObjCName(name = "objCNameProperty1ObjC")
val objCNameProperty1Native: Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>>
  get(): Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
    val tmp_16: CoroutineScope? = null
    val tmp_17: StateFlow<String> = <get-objCNameProperty1>()
    return tmp_17.asNativeFlow<String>(scope = tmp_16)
  }

@ObjCName(name = "objCNameProperty1ObjCValue")
val objCNameProperty1Value: String
  get(): String {
    val tmp_18: StateFlow<String> = <get-objCNameProperty1>()
    return tmp_18.<get-value>()
  }

@ObjCName(name = "objCNameProperty2ObjCFlow")
val objCNameProperty2Flow: Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>>
  get(): Function3<@ParameterName(name = "onItem") Function3<String, Function0<Unit>, Unit, Unit>, @ParameterName(name = "onComplete") Function2<Throwable?, Unit, Unit>, @ParameterName(name = "onCancelled") Function2<Throwable, Unit, Unit>, Function0<Unit>> {
    val tmp_19: CoroutineScope? = null
    val tmp_20: StateFlow<String> = <get-objCNameProperty2>()
    return tmp_20.asNativeFlow<String>(scope = tmp_19)
  }

@ObjCName(name = "objCNameProperty2ObjC")
val objCNameProperty2Value: String
  get(): String {
    val tmp_21: StateFlow<String> = <get-objCNameProperty2>()
    return tmp_21.<get-value>()
  }
