Do not add nullability annotations to the methods of anonymous classes

Nullability annotations are useless for the methods of anonymous classes
due to their restricted scope.

^KT-62044: Fixed
This commit is contained in:
vladislav.grechko
2023-09-04 20:44:13 +02:00
committed by Space Team
parent ed247a3892
commit 29eb1c7a63
55 changed files with 903 additions and 688 deletions
@@ -342,6 +342,7 @@ abstract class AnnotationCodegen(
private fun isInvisibleForNullabilityAnalysis(declaration: IrDeclaration): Boolean =
when {
(declaration.parent as? IrClass)?.isAnonymousObject == true -> true
declaration.origin.isSynthetic ->
true
declaration.origin == JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD ||