[NI] Fix loosing type annotations on extension functions

#KT-32138 fixed
This commit is contained in:
Ilya Chernikov
2019-11-21 18:25:57 +01:00
parent 467e6e3d97
commit 7dd9ed7e38
11 changed files with 153 additions and 4 deletions
@@ -35,9 +35,11 @@ object JvmDeclarationReturnTypeSanitizer : DeclarationReturnTypeSanitizer {
if (languageVersionSettings.supportsFeature(LanguageFeature.StrictJavaNullabilityAssertions)) {
// NB can't check for presence of EnhancedNullability here,
// because it will also cause recursion in declaration type resolution.
inferred.replaceAnnotations(FilteredAnnotations(inferred.annotations) {
it != JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION
})
inferred.replaceAnnotations(
FilteredAnnotations(inferred.annotations, languageVersionSettings.supportsFeature(LanguageFeature.NewInference)) {
it != JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION
}
)
}
else inferred
}