Xcode doesn't warn about missing nullability type specifiers if @interface is declared in a .m file

Originator:heath.borders
Number:rdar://28435410 Date Originated:22-Sep-2016 05:01 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Version 7.3.1 (7D1014)
Classification:Serious Bug Reproducible:Always
 
Summary:
Xcode doesn't warn about missing nullability type specifiers if @interface is declared in a .m file

Steps to Reproduce:

Foo.h:
@interface Foo : NSObject

- (instancetype _Nonnull)initWithString:(NSString *)param1; // Xcode will warn about missing nullability type specifier for param1

@end

Foo.m:

@interface Bar : NSObject

- (instancetype _Nonnull)initWithString:(NSString *)param1; // Xcode will NOT warn about missing nullability type specifier for param1 :(

@end

@implementation Foo

- (instancetype _Nonnull)initWithString:(NSString *)param1 {
  return [super init];
}

@end

@implementation Bar

- (instancetype _Nonnull)initWithString:(NSString *)param1 {
  return [super init];
}

@end


Expected Results:
I expect to receive missing nullability type specifier warnings wherever an @interface is declared

Actual Results:
I only receive missing nullability type specifier warnings when an @interface is declared in a .h file.

Regression:
Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations.

Notes:
Provide additional information, such as references to related problems, workarounds and relevant attachments.

Comments

Apple says this behaves as intended

But they've made an enhancement radar for a stricter warning when @interface is declared inside a .m file.

By heath.borders at Oct. 11, 2016, 12:49 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!