K1: count anonymous function as function expression in checkers

Related to KT-57991
This commit is contained in:
Mikhail Glukhikh
2023-04-15 11:03:52 +02:00
committed by Space Team
parent c8b74e5655
commit 0dbf698653
3 changed files with 3 additions and 8 deletions
@@ -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
@@ -1,7 +0,0 @@
// ISSUE: KT-57991
fun foo() {
<!WRONG_MODIFIER_TARGET!>suspend<!> fun() {
}
}
@@ -1,7 +1,8 @@
// FIR_IDENTICAL
// ISSUE: KT-57991
fun foo() {
suspend fun() {
<!WRONG_MODIFIER_TARGET!>suspend<!> fun() {
}
}