[nullsafe] Support @RecentlyNullable annotation

Summary: See comments for context.

Reviewed By: artempyanykh

Differential Revision: D18590948

fbshipit-source-id: 823b36660
master
Mitya Lyubarskiy 5 years ago committed by Facebook Github Bot
parent 0d175daddc
commit 88d6f67589

@ -95,6 +95,8 @@ let suppress_lint = "SuppressLint"
let suppress_view_nullability = "SuppressViewNullability"
let recently_nullable = "RecentlyNullable"
let thread_confined = "ThreadConfined"
let thread_safe = "ThreadSafe"
@ -174,7 +176,17 @@ let ia_is_not_thread_safe ia = ia_ends_with ia not_thread_safe
let ia_is_propagates_nullable ia = ia_ends_with ia propagates_nullable
let ia_is_nullable ia = ia_ends_with ia nullable || ia_is_propagates_nullable ia
let ia_is_nullable ia =
ia_ends_with ia nullable
(* @RecentlyNullable is a special annotation that was added to solve backward compatibility issues
for Android SDK migration.
See https://android-developers.googleblog.com/2018/08/android-pie-sdk-is-now-more-kotlin.html for details.
From nullsafe point of view, such annotations should be treated exactly as normal @Nullable annotation is treated.
(Actually, IDEs might even show it as @Nullable)
*)
|| ia_ends_with ia recently_nullable
|| ia_is_propagates_nullable ia
let ia_is_nonnull ia = List.exists ~f:(ia_ends_with ia) [nonnull; notnull; camel_nonnull]

Loading…
Cancel
Save