FIR: fix lambda labeling in light tree builder
This commit is contained in:
+6
-6
@@ -128,9 +128,8 @@ class ExpressionsConverter(
|
||||
}
|
||||
}
|
||||
|
||||
val labelName = lambdaExpression.getLabelName() ?: context.firFunctionCalls.lastOrNull()?.calleeReference?.name?.asString()
|
||||
val target = FirFunctionTarget(labelName = labelName, isLambda = true)
|
||||
val expressionSource = lambdaExpression.toFirSourceElement()
|
||||
val target: FirFunctionTarget
|
||||
return buildAnonymousFunction {
|
||||
source = expressionSource
|
||||
session = baseSession
|
||||
@@ -138,6 +137,10 @@ class ExpressionsConverter(
|
||||
receiverTypeRef = implicitType
|
||||
symbol = FirAnonymousFunctionSymbol()
|
||||
isLambda = true
|
||||
label = context.firLabels.pop() ?: context.firFunctionCalls.lastOrNull()?.calleeReference?.name?.let {
|
||||
buildLabel { name = it.asString() }
|
||||
}
|
||||
target = FirFunctionTarget(labelName = label?.name, isLambda = true)
|
||||
context.firFunctionTargets += target
|
||||
var destructuringBlock: FirExpression? = null
|
||||
for (valueParameter in valueParameterList) {
|
||||
@@ -165,10 +168,7 @@ class ExpressionsConverter(
|
||||
valueParameter.firValueParameter
|
||||
}
|
||||
}
|
||||
label = context.firLabels.pop() ?: context.firFunctionCalls.lastOrNull()?.calleeReference?.name?.let {
|
||||
buildLabel { name = it.asString() }
|
||||
}
|
||||
|
||||
|
||||
body = if (block != null) {
|
||||
declarationsConverter.convertBlockExpressionWithoutBuilding(block!!).apply {
|
||||
if (statements.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user