Do not add nullability annotations to the methods of local classes

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

^KT-62513: Fixed
This commit is contained in:
vladislav.grechko
2023-10-11 12:09:55 +02:00
committed by Space Team
parent 417aa236fb
commit 897eab6b50
7 changed files with 23 additions and 26 deletions
@@ -342,7 +342,7 @@ abstract class AnnotationCodegen(
private fun isInvisibleForNullabilityAnalysis(declaration: IrDeclaration): Boolean =
when {
(declaration.parent as? IrClass)?.isAnonymousObject == true -> true
(declaration.parent as? IrClass)?.isLocal == true -> true
declaration.origin.isSynthetic ->
true
declaration.origin == JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD ||