[FIR] KT-55666: Support labels to local functions
^KT-55666 Fixed
This commit is contained in:
committed by
Space Team
parent
f4cda71d9e
commit
ff96033e95
+6
@@ -507,6 +507,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/kt55181.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55666.kt")
|
||||
public void testKt55666() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/kt55666.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55733.kt")
|
||||
public void testKt55733() throws Exception {
|
||||
|
||||
+6
@@ -507,6 +507,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/kt55181.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55666.kt")
|
||||
public void testKt55666() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/kt55666.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55733.kt")
|
||||
public void testKt55733() throws Exception {
|
||||
|
||||
+1
-1
@@ -1676,7 +1676,7 @@ class DeclarationsConverter(
|
||||
}
|
||||
} else {
|
||||
val functionName = identifier.nameAsSafeName()
|
||||
val labelName = runIf(!functionName.isSpecial) { functionName.identifier }
|
||||
val labelName = context.getLastLabel(functionDeclaration)?.name ?: runIf(!functionName.isSpecial) { functionName.identifier }
|
||||
target = FirFunctionTarget(labelName, isLambda = false)
|
||||
functionSymbol = FirNamedFunctionSymbol(callableIdForName(functionName))
|
||||
FirSimpleFunctionBuilder().apply {
|
||||
|
||||
@@ -1435,7 +1435,7 @@ open class RawFirBuilder(
|
||||
FirSimpleFunctionBuilder().apply {
|
||||
receiverParameter = receiverType?.convertToReceiverParameter()
|
||||
name = function.nameAsSafeName
|
||||
labelName = runIf(!name.isSpecial) { name.identifier }
|
||||
labelName = context.getLastLabel(function)?.name ?: runIf(!name.isSpecial) { name.identifier }
|
||||
symbol = FirNamedFunctionSymbol(callableIdForName(function.nameAsSafeName)).also { functionSymbol = it }
|
||||
dispatchReceiverType = currentDispatchReceiverType()
|
||||
status = FirDeclarationStatusImpl(
|
||||
|
||||
Reference in New Issue
Block a user