[JVM IR] Fix issue with destructuring declaration in parameter for
suspend lambda. The Name for the special destructuring declaration parameter was incorrectly turned into a regular/non-special Name when the parameter was moved to a field.
This commit is contained in:
committed by
Ilmir Usmanov
parent
36c4df6d99
commit
137ef26723
+5
-2
@@ -63,13 +63,16 @@ inline fun IrDeclarationContainer.addField(builder: IrFieldBuilder.() -> Unit) =
|
|||||||
declarations.add(field)
|
declarations.add(field)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun IrClass.addField(fieldName: String, fieldType: IrType, fieldVisibility: Visibility = Visibilities.PRIVATE): IrField =
|
fun IrClass.addField(fieldName: Name, fieldType: IrType, fieldVisibility: Visibility = Visibilities.PRIVATE): IrField =
|
||||||
addField {
|
addField {
|
||||||
name = Name.identifier(fieldName)
|
name = fieldName
|
||||||
type = fieldType
|
type = fieldType
|
||||||
visibility = fieldVisibility
|
visibility = fieldVisibility
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun IrClass.addField(fieldName: String, fieldType: IrType, fieldVisibility: Visibility = Visibilities.PRIVATE): IrField =
|
||||||
|
addField(Name.identifier(fieldName), fieldType, fieldVisibility)
|
||||||
|
|
||||||
fun IrPropertyBuilder.buildProperty(): IrProperty {
|
fun IrPropertyBuilder.buildProperty(): IrProperty {
|
||||||
val wrappedDescriptor = WrappedPropertyDescriptor()
|
val wrappedDescriptor = WrappedPropertyDescriptor()
|
||||||
return IrPropertyImpl(
|
return IrPropertyImpl(
|
||||||
|
|||||||
+1
-1
@@ -114,7 +114,7 @@ private class AddContinuationLowering(private val context: JvmBackendContext) :
|
|||||||
addField("p\$", it.type)
|
addField("p\$", it.type)
|
||||||
}
|
}
|
||||||
|
|
||||||
val parametersFields = info.function.valueParameters.map { addField(it.name.asString(), it.type) }
|
val parametersFields = info.function.valueParameters.map { addField(it.name, it.type) }
|
||||||
val parametersWithoutArguments = parametersFields.withIndex()
|
val parametersWithoutArguments = parametersFields.withIndex()
|
||||||
.mapNotNull { (i, field) -> if (info.reference.getValueArgument(i) == null) field else null }
|
.mapNotNull { (i, field) -> if (info.reference.getValueArgument(i) == null) field else null }
|
||||||
val parametersWithArguments = parametersFields - parametersWithoutArguments
|
val parametersWithArguments = parametersFields - parametersWithoutArguments
|
||||||
|
|||||||
-1
@@ -1,5 +1,4 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// COMMON_COROUTINES_TEST
|
// COMMON_COROUTINES_TEST
|
||||||
|
|||||||
Vendored
-1
@@ -1,5 +1,4 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// COMMON_COROUTINES_TEST
|
// COMMON_COROUTINES_TEST
|
||||||
|
|||||||
Reference in New Issue
Block a user