K1: count anonymous function as function expression in checkers
Related to KT-57991
This commit is contained in:
committed by
Space Team
parent
c8b74e5655
commit
0dbf698653
@@ -394,6 +394,7 @@ class AnnotationChecker(
|
|||||||
is KtFunction -> {
|
is KtFunction -> {
|
||||||
when {
|
when {
|
||||||
ExpressionTypingUtils.isFunctionExpression(descriptor) -> TargetLists.T_FUNCTION_EXPRESSION
|
ExpressionTypingUtils.isFunctionExpression(descriptor) -> TargetLists.T_FUNCTION_EXPRESSION
|
||||||
|
annotated.name == null -> TargetLists.T_FUNCTION_EXPRESSION
|
||||||
annotated.isLocal -> TargetLists.T_LOCAL_FUNCTION
|
annotated.isLocal -> TargetLists.T_LOCAL_FUNCTION
|
||||||
annotated.parent is KtClassOrObject || annotated.parent is KtClassBody -> TargetLists.T_MEMBER_FUNCTION
|
annotated.parent is KtClassOrObject || annotated.parent is KtClassBody -> TargetLists.T_MEMBER_FUNCTION
|
||||||
else -> TargetLists.T_TOP_LEVEL_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
|
// ISSUE: KT-57991
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
suspend fun() {
|
<!WRONG_MODIFIER_TARGET!>suspend<!> fun() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user