Xcode block autocomplete is broken when blocks are annotated with nullability

Originator:matej
Number:rdar://20835509 Date Originated:06-May-2015 03:58 PM
Status:Open Resolved:
Product:Developer Tools Product Version:6.3.1 (6D1002)
Classification:Feature (New) Reproducible:Always
 
Summary:

The code editor autocompletion feature in Xcode 6.3 incorrectly auto-completes method parameter blocks that have been annotated for nullability (say defined inside a NS_ASSUME_NONNULL_BEGIN / NS_ASSUME_NONNULL_END block). For the autocompleted blocks, method parameters are missing and extra nullability specifiers (e.g.,  __nonnull) are added. 

Steps to Reproduce:

Open the provided example project in Xcode 6.3.1. Follow the instructions in the comment of -[AppDelegate application:didFinishLaunchingWithOptions:]. 

Expected Results:

The code completion for the example should be like this: [self myBlockMethod:^id (NSObject *object) {}];

Actual Results:

The code completion ends up looking like this: [self myBlockMethod:^id  __nonnull(NSObject * __nonnull) {}];

Comments

Duplicate

rdar://20755276

Sample project

http://cl.ly/1T0u1G0p2M0H


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!