ronantakizawa/codereview-bench huggingface dataset:
Repository: JetBrains/kotlin
File: idea/idea-frontend-independent/src/org/jetbrains/kotlin/idea/quickfix/AddFunctionBodyFix.kt (Kotlin)

Code before:
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtFunction
import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType

class AddFunctionBodyFix(element: KtFunction) : KotlinPsiOnlyQuickFixAction<KtFunction>(element) {
    override fun getFamilyName() = KotlinBundle.message("fix.add.function.body")
    override fun getText() = familyName

    override fun isAvailable(project: Project, editor: Editor?, file: KtFile): Boolean {
        val element = element ?: return false
        return !element.hasBody()
    }

    public override fun invoke(project: Project, editor: Editor?, file: KtFile) {
        val element = element ?: return
        if (!element.hasBody()) {
            element.add(KtPsiFactory(project).createEmptyBody())
        }
    }

    companion object : QuickFixesPsiBasedFactory<KtFunction>(KtFunction::class, PsiElementSuitabilityCheckers.ALWAYS_SUITABLE) {
        override fun doCreateQuickFix(psiElement: KtFunction): List<IntentionAction> {
            return listOfNotNull(psiElement.getNonStrictParentOfType<KtFunction>()?.let(::AddFunctionBodyFix))
        }
    }
}


Review comment (suggestion):
I know you didn't change this, but I'm a little confused here. If `psiElement` is the function without a body, why do we even need to get the parent? Shouldn't this just be `return listOf(AddFunctionBodyFix(psiElement)`?

I think `getNonStrictParentOfType` returns the argument if it matches the type (`KtFunction`) so the call doesn't even do anything.

Code after:
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtFunction
import org.jetbrains.kotlin.psi.KtPsiFactory

class AddFunctionBodyFix(element: KtFunction) : KotlinPsiOnlyQuickFixAction<KtFunction>(element) {
    override fun getFamilyName() = KotlinBundle.message("fix.add.function.body")
    override fun getText() = familyName

    override fun isAvailable(project: Project, editor: Editor?, file: KtFile): Boolean {
        val element = element ?: return false
        return !element.hasBody()
    }

    public override fun invoke(project: Project, editor: Editor?, file: KtFile) {
        val element = element ?: return
        if (!element.hasBody()) {
            element.add(KtPsiFactory(project).createEmptyBody())
        }
    }

    companion object : QuickFixesPsiBasedFactory<KtFunction>(KtFunction::class, PsiElementSuitabilityCheckers.ALWAYS_SUITABLE) {
        override fun doCreateQuickFix(psiElement: KtFunction): List<IntentionAction> = listOfNotNull(AddFunctionBodyFix(psiElement))
    }
}
Repository: JetBrains/kotlin
File: compiler/testData/codegen/box/inlineClasses/kt44867.kt (Kotlin)

Code before:
// WITH_RUNTIME
// IGNORE_BACKEND: JVM

open class BaseWrapper<T>(val response: T)
class Wrapper(result: Result<String>) : BaseWrapper<Result<String>>(result)

fun box(): String {
    return Wrapper(Result.success("OK")).response.getOrThrow())
}


Review comment (bug):
Looks like there's an extra `)` here, which is why this test fails for example for JS, JS_IR and WASM. I wonder why it passes for JVM_IR though...

Code after:
// WITH_RUNTIME
// IGNORE_BACKEND: JVM

open class BaseWrapper<T>(val response: T)
class Wrapper(result: Result<String>) : BaseWrapper<Result<String>>(result)

fun box(): String {
    return Wrapper(Result.success("OK")).response.getOrThrow()
}
Repository: JetBrains/kotlin
File: compiler/testData/codegen/box/bridges/kt46389_jvmDefault.kt (Kotlin)

Code before:

// Before the fix to kt46389, the IR backend would have added a bridge
// for `h$default` in `B`, which would have lead both calls to use "K"
// as the default value. This would arguably be less surprising, but is
// impossible to match without jvm-default on the JVM(-IR)backend.
//
// Meanwhile, the two calls using "K" as the default value is the current
// behavior on the JS backend, which is why the test is muted for the JS
// backend.

interface I {
    fun h(x: String = "O"): Any
}

interface I2 : I

open class A {
    fun h(x: String = "K") = x
}

class B : A(), I2

fun box(): String {
    return "${(B() as I).h()}${B().h()}"
}


Review comment (bug):
Looks like this test fails with ` java.lang.ClassFormatError: Method h$default in class I has illegal modifiers: 0x1009` on both backends

Code after:
// The code in this test should be prohibited in the frontend, see KT-36188.

// Before the fix to kt46389, the IR backend would have added a bridge
// for `h$default` in `B`, which would have lead both calls to use "K"
// as the default value. This would arguably be less surprising, but is
// impossible to match without jvm-default on the JVM(-IR)backend.
//
// Meanwhile, the two calls using "K" as the default value is the current
// behavior on the JS backend, which is why the test is muted for the JS
// backend.

interface I {
    fun h(x: String = "O"): Any
}

interface I2 : I

open class A {
    fun h(x: String = "K") = x
}

class B : A(), I2

fun box(): String {
    return "${(B() as I).h()}${B().h()}"
}
Repository: JetBrains/kotlin
File: compiler/testData/codegen/box/optimizations/kt46921.kt (Kotlin)

Code before:
// TARGET_PLATFORM: JVM
// FILE: I.java
public interface I<T> {
    public T create();
}

// FILE: box.kt
// A specific bytecode pattern here may confuse POP propagation.
inline fun <reified T, V : Any> I<V>.bar(default: T, crossinline baz: V.(T) -> T) =
    u@{ it: Any? -> create().baz(it as? T ?: return@u default) }

fun box() = I<String> { "O" }.bar("fail") { this + it }("K")


Review comment (suggestion):
`TARGET_BACKEND` + regenerate tests pls.

But also consider moving this test to `boxInline`, to test the two-module scenario too

Code after:
// TARGET_BACKEND: JVM
// FILE: I.java
public interface I<T> {
    public T create();
}

// FILE: box.kt
// A specific bytecode pattern here may confuse POP propagation.
inline fun <reified T, V : Any> I<V>.bar(default: T, crossinline baz: V.(T) -> T) =
    u@{ it: Any? -> create().baz(it as? T ?: return@u default) }

fun box() = I<String> { "O" }.bar("fail") { this + it }("K")
Repository: JetBrains/kotlin
File: compiler/testData/codegen/box/annotations/annotationDefaultValueOfUnsigned.kt (Kotlin)

Code before:
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
// WITH_REFLECT
// FULL_JDK

annotation class Ann1(val value: UByte = 41u)
annotation class Ann2(val value: UShort = 42u)
annotation class Ann3(val value: UInt = 43u)
annotation class Ann4(val value: ULong = 44u)

@Ann1
@Ann2
@Ann3
@Ann4
class A

fun box(): String {
    val default1 = A::class.java.getDeclaredAnnotation(Ann1::class.java).value
    val default2 = A::class.java.getDeclaredAnnotation(Ann2::class.java).value
    val default3 = A::class.java.getDeclaredAnnotation(Ann3::class.java).value
    val default4 = A::class.java.getDeclaredAnnotation(Ann4::class.java).value

    return if (default1 == 41u.toUByte() &&
        default2 == 42u.toUShort() &&
        default3 == 43u &&
        default4 == 44u.toULong()
    ) "OK"
    else "FAIL"
}


Review comment (bug):
`Class.getDeclaredAnnotation` is missing on JDK6 and older versions of Android, so the corresponding tests (`compiler/tests-different-jdk`, `compiler/android-tests`) are failing. Let's use `Class.getAnnotation` instead

Code after:
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
// WITH_REFLECT
// FULL_JDK

annotation class Ann1(val value: UByte = 41u)
annotation class Ann2(val value: UShort = 42u)
annotation class Ann3(val value: UInt = 43u)
annotation class Ann4(val value: ULong = 44u)

@Ann1
@Ann2
@Ann3
@Ann4
class A

fun box(): String {
    val default1 = A::class.java.getAnnotation(Ann1::class.java).value
    val default2 = A::class.java.getAnnotation(Ann2::class.java).value
    val default3 = A::class.java.getAnnotation(Ann3::class.java).value
    val default4 = A::class.java.getAnnotation(Ann4::class.java).value

    return if (default1 == 41u.toUByte() &&
        default2 == 42u.toUShort() &&
        default3 == 43u &&
        default4 == 44u.toULong()
    ) "OK"
    else "FAIL"
}
Repository: JetBrains/kotlin
File: libraries/stdlib/jdk8/src/kotlin/jvm/optionals/Optionals.kt (Kotlin)

Code before:
/*
 * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
 */

package kotlin.jvm.optionals

import java.util.Optional

/**
 * Returns this [Optional]'s value if [present][Optional.isPresent], or otherwise `null`.
 */
public fun <T : Any> Optional<out T>.getOrNull(): T? = orElse(null)

/**
 * Returns this [Optional]'s value if [present][Optional.isPresent], or otherwise [defaultValue].
 */
public fun <R, T : R & Any> Optional<out T>.getOrDefault(defaultValue: R): R = if (isPresent) get() else defaultValue

/**
 * Returns this [Optional]'s value if [present][Optional.isPresent], or otherwise the result of the [defaultValue] function.
 */
public inline fun <R, T : R & Any> Optional<out T>.getOrElse(defaultValue: () -> R): R =
    if (isPresent) get() else defaultValue()

/**
 * Appends this [Optional]'s value to the given [destination] collection if [present][Optional.isPresent].
 */
public fun <T : Any, C : MutableCollection<in T>> Optional<out T>.toCollection(destination: C): C {
    if (isPresent) {
        destination.add(get())
    }
    return destination
}

/**
 * Returns a new read-only list of this [Optional]'s value if [present][Optional.isPresent], or otherwise an empty list.
 * The returned list is serializable (JVM).
 */
public fun <T : Any> Optional<out T>.toList(): List<T> =
    if (isPresent) listOf(get()) else emptyList()

/**

Review comment (suggestion):
Let's annotate all new functions with 
```
@SinceKotlin("1.7")
@ExperimentalStdlibApi
```

Code after:
/*
 * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
 */

package kotlin.jvm.optionals

import java.util.Optional

/**
 * Returns this [Optional]'s value if [present][Optional.isPresent], or otherwise `null`.
 */
@SinceKotlin("1.7")
@ExperimentalStdlibApi
public fun <T : Any> Optional<T>.getOrNull(): T? = orElse(null)

/**
 * Returns this [Optional]'s value if [present][Optional.isPresent], or otherwise [defaultValue].
 */
@SinceKotlin("1.7")
@ExperimentalStdlibApi
public fun <R, T : R & Any> Optional<T>.getOrDefault(defaultValue: R): R = if (isPresent) get() else defaultValue

/**
 * Returns this [Optional]'s value if [present][Optional.isPresent], or otherwise the result of the [defaultValue] function.
 */
@SinceKotlin("1.7")
@ExperimentalStdlibApi
public inline fun <R, T : R & Any> Optional<T>.getOrElse(defaultValue: () -> R): R =
    if (isPresent) get() else defaultValue()

/**
 * Appends this [Optional]'s value to the given [destination] collection if [present][Optional.isPresent].
 */
@SinceKotlin("1.7")
@ExperimentalStdlibApi
public fun <T : Any, C : MutableCollection<in T>> Optional<T>.toCollection(destination: C): C {
    if (isPresent) {
        destination.add(get())
    }
    return destination
}
Repository: JetBrains/kotlin
File: compiler/testData/checkLocalVariablesTable/underscoreNames.kt (Kotlin)

Code before:
data class A(val x: Double = 1.0, val y: String = "", val z: Char = '0')

fun foo(a: A, block: (A, String, Int) -> String): String = block(a, "", 1)

val arrayOfA: Array<A> = Array(1) { A() }

fun box() {

    foo(A()) {
        (x, _, y), _, w ->

        val (a, _, c) = A()
        val (_, `_`, d) = A()

        for ((_, q) in arrayOfA) {

        }

        ""
    }
}

// METHOD : UnderscoreNamesKt$box$1.invoke(LA;Ljava/lang/String;I)Ljava/lang/String;
// VARIABLE : NAME=x TYPE=D INDEX=4
// VARIABLE : NAME=y TYPE=C INDEX=6
// VARIABLE : NAME=d TYPE=C INDEX=11
// VARIABLE : NAME=_ TYPE=Ljava/lang/String; INDEX=10
// VARIABLE : NAME=c TYPE=C INDEX=9
// VARIABLE : NAME=a TYPE=D INDEX=7
// VARIABLE : NAME=this TYPE=LUnderscoreNamesKt$box$1; INDEX=0

// JVM_TEMPLATES
// VARIABLE : NAME=$dstr$x$_u24__u24$y TYPE=LA; INDEX=1
// VARIABLE : NAME=$noName_1 TYPE=Ljava/lang/String; INDEX=2
// VARIABLE : NAME=w TYPE=I INDEX=3

// JVM_IR_TEMPLATES
// VARIABLE : NAME=w TYPE=I INDEX=3


Review comment (bug):
The change here is that in fact there is no place where the q is visible in the debugger before and after this change. 

The code is:

```
for ((_, q) in arrayOfA) {

}
```

The q is in the local variable table covering exactly one `iinc` instruction in the generated code before this change. That `iinc` instruction is part of the condition and therefore we do not put in the `q` at all. From a debugger perspective it doesn't matter.


Code after:
data class A(val x: Double = 1.0, val y: String = "", val z: Char = '0')

fun foo(a: A, block: (A, String, Int) -> String): String = block(a, "", 1)

val arrayOfA: Array<A> = Array(1) { A() }

fun box() {

    foo(A()) {
        (x, _, y), _, w ->

        val (a, _, c) = A()
        val (_, `_`, d) = A()

        for ((_, q) in arrayOfA) {
            Unit
        }

        ""
    }
}

// METHOD : UnderscoreNamesKt$box$1.invoke(LA;Ljava/lang/String;I)Ljava/lang/String;
// VARIABLE : NAME=x TYPE=D INDEX=4
// VARIABLE : NAME=y TYPE=C INDEX=6
// VARIABLE : NAME=q TYPE=Ljava/lang/String; INDEX=16
// VARIABLE : NAME=d TYPE=C INDEX=11
// VARIABLE : NAME=_ TYPE=Ljava/lang/String; INDEX=10
// VARIABLE : NAME=c TYPE=C INDEX=9
// VARIABLE : NAME=a TYPE=D INDEX=7
// VARIABLE : NAME=this TYPE=LUnderscoreNamesKt$box$1; INDEX=0

// JVM_TEMPLATES
// VARIABLE : NAME=$dstr$x$_u24__u24$y TYPE=LA; INDEX=1
// VARIABLE : NAME=$noName_1 TYPE=Ljava/lang/String; INDEX=2
// VARIABLE : NAME=w TYPE=I INDEX=3

// JVM_IR_TEMPLATES
// VARIABLE : NAME=w TYPE=I INDEX=3
Repository: JetBrains/kotlin
File: kotlin-native/backend.native/tests/objcexport/coroutines.swift (Swift)

Code before:
    var error: Error? = nil
    var completionCalled = 0

    let group = DispatchGroup()

#if ALLOW_SUSPEND_ANY_THREAD
#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT
    DispatchQueue.global().async(group: group) {
        CoroutinesKt.unitSuspendFun { _result, _error in
            completionCalled += 1
            result = _result
            error = _error
        }
    }
#else
    DispatchQueue.global().async(group: group) {
        CoroutinesKt.unitSuspendFun { _error in
            completionCalled += 1
            error = _error
        }
    }
#endif
#endif

    group.wait()
    try assertNil(error)
}


private func testCallSuspendFun(doSuspend: Bool, doThrow: Bool) throws {
    class C {}
    let expectedResult = C()

    var completionCalled = 0
    var result: AnyObject? = nil
    var error: Error? = nil

    CoroutinesKt.suspendFun(result: expectedResult, doSuspend: doSuspend, doThrow: doThrow) { _result, _error in
        completionCalled += 1
        result = _result as AnyObject?
        error = _error
    }

    try assertEquals(actual: completionCalled, expected: 1)

    if doThrow {
        try assertNil(result)
        try assertTrue(error?.kotlinException is CoroutineException)
    } else {
        try assertSame(actual: result, expected: expectedResult)
        try assertNil(error)

Review comment (suggestion):
```suggestion
    try assertEquals(actual: completionCalled, expected: 1)
    try assertNil(error)
```

Code after:
    var error: Error? = nil
    var completionCalled = 0

    let group = DispatchGroup()

#if ALLOW_SUSPEND_ANY_THREAD
#if LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT
    DispatchQueue.global().async(group: group) {
        CoroutinesKt.unitSuspendFun { _result, _error in
            completionCalled += 1
            result = _result
            error = _error
        }
    }
#else
    DispatchQueue.global().async(group: group) {
        CoroutinesKt.unitSuspendFun { _error in
            completionCalled += 1
            error = _error
        }
    }
#endif
#endif

#if ALLOW_SUSPEND_ANY_THREAD
    group.wait()
    try assertEquals(actual: completionCalled, expected: 1)
#endif
}


private func testCallSuspendFun(doSuspend: Bool, doThrow: Bool) throws {
    class C {}
    let expectedResult = C()

    var completionCalled = 0
    var result: AnyObject? = nil
    var error: Error? = nil

    CoroutinesKt.suspendFun(result: expectedResult, doSuspend: doSuspend, doThrow: doThrow) { _result, _error in
        completionCalled += 1
        result = _result as AnyObject?
        error = _error
    }

    try assertEquals(actual: completionCalled, expected: 1)

    if doThrow {
        try assertNil(result)
        try assertTrue(error?.kotlinException is CoroutineException)
    } else {
Repository: JetBrains/kotlin
File: compiler/testData/codegen/box/sam/kt52417.kt (Kotlin)

Code before:
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// WITH_STDLIB
abstract class TypeToken<T>

fun interface I {
    fun foo(): String
}

fun <T> foo() =
    I {
        (object : TypeToken<T>() {})::class.java.genericSuperclass.toString()
    }.foo()

fun box(): String =
    foo<String>().let { if (it == "TypeToken<T>") "OK" else it }


Review comment (bug):
Please add `package test` here, otherwise the test fails if run as a part of `compiler/android-tests` (explicit package directive helps since that configuration replaces package in each test with a unique name by regexp, and runs all tests in a single project)

Code after:
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// WITH_STDLIB
package test

abstract class TypeToken<T>

fun interface I {
    fun foo(): String
}

fun <T> foo() =
    I {
        (object : TypeToken<T>() {})::class.java.genericSuperclass.toString()
    }.foo()

fun box(): String =
    foo<String>().let { if (it == "test.TypeToken<T>") "OK" else it }
Repository: JetBrains/kotlin
File: compiler/testData/codegen/box/defaultArguments/kt52702.kt (Kotlin)

Code before:
// Check that local variables for inline functions and inline default lambdas start
// after they are initialized.

inline fun spray() {
    val a = Any()
    val b = Any()
    val c = Any()
    val d = Any()
    val e = Any()
}

inline fun f(block: () -> String = { "OK" }): String = block()

fun box(): String {
    // On the JVM, this call adds some locals with reference types to the LVT
    // which end after the call returns.
    spray()
    // When inlining `f` we'll reuse the same slots that previously contained
    // locals with reference types for the $i$f$f and $i$a$-f-... variables.
    // Since these locals have integer types D8 would produce a warning if they
    // started before being initialized, which would cause the test to fail.
    return f()
}


Review comment (bug):
Please ignore the test for `JS` backend, otherwise `JsCodegenBoxTestGenerated.DefaultArguments.testKt52702` fails

Code after:
// IGNORE_BACKEND: JS
// Check that local variables for inline functions and inline default lambdas start
// after they are initialized.

inline fun spray() {
    val a = Any()
    val b = Any()
    val c = Any()
    val d = Any()
    val e = Any()
}

inline fun f(block: () -> String = { "OK" }): String = block()

fun box(): String {
    // On the JVM, this call adds some locals with reference types to the LVT
    // which end after the call returns.
    spray()
    // When inlining `f` we'll reuse the same slots that previously contained
    // locals with reference types for the $i$f$f and $i$a$-f-... variables.
    // Since these locals have integer types D8 would produce a warning if they
    // started before being initialized, which would cause the test to fail.
    return f()
}
Repository: JetBrains/kotlin
File: plugins/atomicfu/atomicfu-runtime/build.gradle.kts (Kotlin)

Code before:
plugins {
    kotlin("js")
    `maven-publish`
}

group = "org.jetbrains.kotlin"

repositories {
    mavenCentral()
}

kotlin {
    js() {
        browser()
        nodejs()
    }

    sourceSets {
        js().compilations["main"].defaultSourceSet {
            dependencies {
                compileOnly(kotlin("stdlib-js"))
            }
        }
    }
}

publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["kotlin"])
        }
    }
}


Review comment (suggestion):
Please also add here before `publishing {`: `configureCommonPublicationSettingsForGradle()`.

This will add common Kotlin publication info.

Code after:
plugins {
    kotlin("js")
    `maven-publish`
}

group = "org.jetbrains.kotlin"

repositories {
    mavenCentral()
}

kotlin {
    js() {
        browser()
        nodejs()
    }

    sourceSets {
        js().compilations["main"].defaultSourceSet {
            dependencies {
                compileOnly(kotlin("stdlib-js"))
            }
        }
    }
}

configureCommonPublicationSettingsForGradle()

publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["kotlin"])
        }
    }
}
Repository: JetBrains/kotlin
File: plugins/atomicfu/atomicfu-runtime/build.gradle.kts (Kotlin)

Code before:
description = "Runtime library for the Atomicfu compiler plugin"

plugins {
    kotlin("js")
    `maven-publish`
}

group = "org.jetbrains.kotlin"

repositories {
    mavenCentral()
}

kotlin {
    js() {
        browser()
        nodejs()
    }

    sourceSets {
        js().compilations["main"].defaultSourceSet {
            dependencies {
                compileOnly(kotlin("stdlib-js"))
            }
        }
    }
}

publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["kotlin"])
        }

Review comment (suggestion):
I would propose to change name as well - could be done in `settings.gradle` after line 800:
```groovy
project(':kotlinx-atomicfu-runtime').name = 'atomicfu-runtime'
```

Code after:
description = "Runtime library for the Atomicfu compiler plugin"

plugins {
    kotlin("js")
    `maven-publish`
}

group = "org.jetbrains.kotlin"

repositories {
    mavenCentral()
}

kotlin {
    js() {
        browser()
        nodejs()
    }

    sourceSets {
        js().compilations["main"].defaultSourceSet {
            dependencies {
                compileOnly(kotlin("stdlib-js"))
            }
        }
    }
}

configureCommonPublicationSettingsForGradle()

publishing {
    publications {
        create<MavenPublication>("maven") {
Repository: JetBrains/kotlin
File: compiler/testData/codegen/box/coroutines/featureIntersection/funInterface/kt50950.kt (Kotlin)

Code before:
// IGNORE_BACKEND: JVM
// WITH_COROUTINES
// WITH_STDLIB
// FILE: a.kt
fun interface A {
    suspend fun run()
}

// FILE: b.kt
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
import helpers.EmptyContinuation

suspend fun run(block: () -> Unit) = A(block).run()

fun box(): String {
    suspend {
        run {}
    }.startCoroutine(EmptyContinuation)
    return "OK"
}


Review comment (bug):
The test fails in FIR:
```
  java.lang.ClassCastException: BKt$box$1$1 cannot be cast to kotlin.jvm.functions.Function1
    at BKt.run(b.kt:14)
    at BKt$box$1.invokeSuspend(b.kt:18)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
    at BKt.box(b.kt:19)
```

Code after:
// IGNORE_BACKEND: JVM
// WITH_COROUTINES
// WITH_STDLIB
// FILE: a.kt
fun interface A {
    suspend fun run()
}

// FILE: b.kt
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
import helpers.EmptyContinuation

suspend fun run(block: suspend () -> Unit) = A(block).run()

fun box(): String {
    suspend {
        run {}
    }.startCoroutine(EmptyContinuation)
    return "OK"
}