New J2K: use PsiModifierListOwner instead of JvmAnnotatedElement for getting annotations from declaration while building AST as PsiLocalVariable is no longer a JvmAnnotatedElement in 192

#KT-31821 fixed
This commit is contained in:
Ilya Kirillov
2019-06-14 15:11:50 +03:00
parent ae2ef0ac79
commit d6dec2a066
@@ -639,7 +639,7 @@ class JavaToJKTreeBuilder constructor(
}
}
fun <T : JvmAnnotatedElement> T.annotationList(docCommentOwner: PsiDocCommentOwner?): JKAnnotationList {
fun <T : PsiModifierListOwner> T.annotationList(docCommentOwner: PsiDocCommentOwner?): JKAnnotationList {
val plainAnnotations = annotations.map { it.cast<PsiAnnotation>().toJK() }
val deprecatedAnnotation = docCommentOwner?.docComment?.deprecatedAnnotation() ?: return JKAnnotationListImpl(plainAnnotations)
return JKAnnotationListImpl(