[nullsafe] --no-nullsafe-optimistic-third-party-in-default-mode is optimistic about Inheritance check

Summary: This is needed for migration purposes.

Reviewed By: artempyanykh

Differential Revision: D26543726

fbshipit-source-id: 2dd8928bb
master
Mitya Lyubarskiy 4 years ago committed by Facebook GitHub Bot
parent 1e36735f14
commit 481068d3da

@ -95,6 +95,13 @@ module ReportableViolation = struct
end
let check type_role ~base ~overridden =
if Nullability.equal Nullability.ThirdPartyNonnull base then
(* In context of inheritance check, third party declarations in base are treated optimistically.
Meaning return values are assumed [@Nullable] and params are assumed [@NonNull].
This is done for compatibility reasons so existing [@Nullsafe] classes are preserved Nullsafe.
*)
Ok ()
else
let subtype, supertype =
match type_role with
| Ret ->

Loading…
Cancel
Save