diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt index a0b31af71c7..b90886cc78d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt @@ -394,6 +394,7 @@ class AnnotationChecker( is KtFunction -> { when { ExpressionTypingUtils.isFunctionExpression(descriptor) -> TargetLists.T_FUNCTION_EXPRESSION + annotated.name == null -> TargetLists.T_FUNCTION_EXPRESSION annotated.isLocal -> TargetLists.T_LOCAL_FUNCTION annotated.parent is KtClassOrObject || annotated.parent is KtClassBody -> TargetLists.T_MEMBER_FUNCTION else -> TargetLists.T_TOP_LEVEL_FUNCTION diff --git a/compiler/testData/diagnostics/tests/modifiers/suspendAnonymousFunction.fir.kt b/compiler/testData/diagnostics/tests/modifiers/suspendAnonymousFunction.fir.kt deleted file mode 100644 index c98c25018e2..00000000000 --- a/compiler/testData/diagnostics/tests/modifiers/suspendAnonymousFunction.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// ISSUE: KT-57991 - -fun foo() { - suspend fun() { - - } -} diff --git a/compiler/testData/diagnostics/tests/modifiers/suspendAnonymousFunction.kt b/compiler/testData/diagnostics/tests/modifiers/suspendAnonymousFunction.kt index 826ebbe6ab6..839a6f3887c 100644 --- a/compiler/testData/diagnostics/tests/modifiers/suspendAnonymousFunction.kt +++ b/compiler/testData/diagnostics/tests/modifiers/suspendAnonymousFunction.kt @@ -1,7 +1,8 @@ +// FIR_IDENTICAL // ISSUE: KT-57991 fun foo() { - suspend fun() { + suspend fun() { } }