Swift interop and obj-c nullability completeness warnings

I work on what was originally a large objective-c codebase that has been migrating to swift during the past couple years. One issue that has nagged at me is the sheer number of warnings in the following form:

error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)

If our intent is to leave all these as _Null_unspecified (without explicitly annotating them as such) and migrate to Swift, is there any good reason not to disable this warning?

Related prior discussion: Swift should allow for suppression of warnings, especially those that come from Objective-C

That warning is specifically defined per-file; it should not fire unless you have at least one nullability specifier in that file (the thought being that the most common way to adopt nullability would be by auditing one logical grouping of classes or functions at a time, which usually maps to one file).

3 Likes
Terms of Service

Privacy Policy

Cookie Policy