Don't ignore Java nullability annotations without target and unresolved when nullability qualifiers are extracted, with enabled type enhancement improvements

^KT-47276 Fixed
This commit is contained in:
Victor Petukhov
2021-06-15 14:31:34 +03:00
parent ae03e2983d
commit 85f4cec948
6 changed files with 97 additions and 1 deletions
@@ -332,7 +332,8 @@ class SignatureEnhancement(
val composedAnnotation =
if (isHeadTypeConstructor && typeContainer != null && typeContainer !is TypeParameterDescriptor && areImprovementsInStrictMode) {
val filteredContainerAnnotations = typeContainer.annotations.filter {
val (_, targets) = annotationTypeQualifierResolver.resolveAnnotation(it) ?: return@filter false
val (_, targets) = annotationTypeQualifierResolver.resolveAnnotation(it)
?: return@filter true // don't exclude annotations without specified target or unresolved
/*
* We don't apply container type use annotations to avoid double applying them like with arrays:
* @NotNull Integer [] f15();