[CFA] Mark arguments of all annotation calls as USED_AS_EXPRESSION

Also revert hacky fix of KT-37294 introduced in 80caa063b
#KT-37447 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-03-12 18:53:45 +03:00
parent b9ffed3f04
commit 31776d9a3b
7 changed files with 193 additions and 11 deletions
@@ -804,9 +804,14 @@ class ControlFlowInformationProvider private constructor(
}
private fun markAnnotationArguments() {
when (subroutine) {
is KtAnnotationEntry -> markAnnotationArguments(subroutine)
is KtAnnotated -> subroutine.annotationEntries.forEach { markAnnotationArguments(it) }
if (subroutine is KtAnnotationEntry) {
markAnnotationArguments(subroutine)
} else {
subroutine.children.forEach { child ->
child.forEachDescendantOfType<KtAnnotationEntry>(
canGoInside = { it !is KtDeclaration || it is KtParameter }
) { markAnnotationArguments(it) }
}
}
}