JS IR: fix origin for callable references with bound reciever
In case of IrFunctionReference with type SuspendFunction (no K!) there was a misalignment between the base class (Any) and the origin (LAMBDA..). As a result the SuspendFunctionLowering was getting confused and produced hanging code.
This commit is contained in:
+1
-1
@@ -122,7 +122,7 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod
|
||||
visibility = Visibilities.LOCAL
|
||||
// A callable reference results in a synthetic class, while a lambda is not synthetic.
|
||||
// We don't produce GENERATED_SAM_IMPLEMENTATION, which is always synthetic.
|
||||
origin = if (isKReference) FUNCTION_REFERENCE_IMPL else LAMBDA_IMPL
|
||||
origin = if (isKReference || !isLambda) FUNCTION_REFERENCE_IMPL else LAMBDA_IMPL
|
||||
name = SpecialNames.NO_NAME_PROVIDED
|
||||
}.apply {
|
||||
superTypes = listOf(superClass, reference.type)
|
||||
|
||||
Vendored
-2
@@ -2,8 +2,6 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// ^ this test hangs on JS_IR (even if it's IGNOREd)
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
import helpers.*
|
||||
|
||||
Vendored
-2
@@ -2,8 +2,6 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// ^ this test hangs on JS_IR (even if it's IGNOREd)
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
import helpers.*
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// ^ TODO fix suspend coercion for bound function references in JVM_IR
|
||||
// FILE: suspendCovnersion.kt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user