diff --git a/plugins/kotlin/code-insight/fixes-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/fixes/CreateLabelFixFactories.kt b/plugins/kotlin/code-insight/fixes-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/fixes/CreateLabelFixFactories.kt index 094b27b0d78e..8b85b7654373 100644 --- a/plugins/kotlin/code-insight/fixes-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/fixes/CreateLabelFixFactories.kt +++ b/plugins/kotlin/code-insight/fixes-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/fixes/CreateLabelFixFactories.kt @@ -11,7 +11,8 @@ import org.jetbrains.kotlin.psi.* internal object CreateLabelFixFactories { val unresolvedLabelFactory = KotlinQuickFixFactory.IntentionBased { diagnostic: KaFirDiagnostic.UnresolvedLabel -> - val labelReferenceExpression = diagnostic.psi as? KtLabelReferenceExpression ?: return@IntentionBased emptyList() + val labelReferenceExpression = diagnostic.psi as? KtLabelReferenceExpression + ?: (diagnostic.psi as? KtReturnExpression)?.getTargetLabel() as? KtLabelReferenceExpression ?: return@IntentionBased emptyList() return@IntentionBased getFixes(labelReferenceExpression) } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt index c1e06dfc2951..0e0f042a0dd6 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt @@ -1,6 +1,3 @@ -/* IGNORE_K2 */ -// Remove this ignoring after KT-69829 is fixed - // "Create label foo@" "true" inline fun Int.bar(f: (Int) -> Unit) { } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt.after index 88032abe9f6b..afc60e8f92f9 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt.after +++ b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInLambda.kt.after @@ -1,6 +1,3 @@ -/* IGNORE_K2 */ -// Remove this ignoring after KT-69829 is fixed - // "Create label foo@" "true" inline fun Int.bar(f: (Int) -> Unit) { } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt index 47f67ade81b2..1010df00360a 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt @@ -1,6 +1,3 @@ -/* IGNORE_K2 */ -// Remove this ignoring after KT-69829 is fixed - // "Create label foo@" "true" inline fun Int.bar(f: (Int) -> Unit) { } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt.after index 0f4663741ec8..d4efe8f9a754 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt.after +++ b/plugins/kotlin/idea/tests/testData/quickfix/createLabel/returnInOuterLambda.kt.after @@ -1,6 +1,3 @@ -/* IGNORE_K2 */ -// Remove this ignoring after KT-69829 is fixed - // "Create label foo@" "true" inline fun Int.bar(f: (Int) -> Unit) { }