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 expressionSource = lambdaExpression.toFirSourceElement()
|
||||||
|
val target: FirFunctionTarget
|
||||||
return buildAnonymousFunction {
|
return buildAnonymousFunction {
|
||||||
source = expressionSource
|
source = expressionSource
|
||||||
session = baseSession
|
session = baseSession
|
||||||
@@ -138,6 +137,10 @@ class ExpressionsConverter(
|
|||||||
receiverTypeRef = implicitType
|
receiverTypeRef = implicitType
|
||||||
symbol = FirAnonymousFunctionSymbol()
|
symbol = FirAnonymousFunctionSymbol()
|
||||||
isLambda = true
|
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
|
context.firFunctionTargets += target
|
||||||
var destructuringBlock: FirExpression? = null
|
var destructuringBlock: FirExpression? = null
|
||||||
for (valueParameter in valueParameterList) {
|
for (valueParameter in valueParameterList) {
|
||||||
@@ -165,10 +168,7 @@ class ExpressionsConverter(
|
|||||||
valueParameter.firValueParameter
|
valueParameter.firValueParameter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label = context.firLabels.pop() ?: context.firFunctionCalls.lastOrNull()?.calleeReference?.name?.let {
|
|
||||||
buildLabel { name = it.asString() }
|
|
||||||
}
|
|
||||||
|
|
||||||
body = if (block != null) {
|
body = if (block != null) {
|
||||||
declarationsConverter.convertBlockExpressionWithoutBuilding(block!!).apply {
|
declarationsConverter.convertBlockExpressionWithoutBuilding(block!!).apply {
|
||||||
if (statements.isEmpty()) {
|
if (statements.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user