NS_ASSUME_NONNULL_BEGIN doesn't apply to block return types

Originator:heath.borders
Number:rdar://30696962 Date Originated:
Status:Open Resolved:24-Feb-2017 10:52 AM
Product:Developer Tools Product Version:Xcode 8.2.1
Classification:Serious Bug Reproducible:Always
 
Summary:
In a header file with NS_ASSUME_NONNULL_BEGIN, clang still wants an explicit nullability specifier in a block's return type.

Steps to Reproduce:
Compile the following header file:

```
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NSString * (^TWNullabilityAssumeNonnullImplicitNonnullReturnTypedefHeaderBlock)(void);

NS_ASSUME_NONNULL_END
```

Expected Results:
No compiler warnings or errors.

Actual Results:
I receive the following error:
```
In file included from /Users/bordersh/workspace/TWNullability/TWNullability/TWNullability/TWNullabilityAssumeNonnullBlocks.m:9:
/Users/bordersh/workspace/TWNullability/TWNullability/TWNullability/TWNullabilityAssumeNonnullBlocks.h:18:18: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
typedef NSString * (^TWNullabilityAssumeNonnullImplicitNonnullReturnTypedefHeaderBlock)(void);
                 ^
1 error generated.
```

Version:
Xcode 8.2.1, OS X 10.2.3

Notes:


Configuration:


Attachments:

Comments


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!