Standard Objective-C assertions like NSCAssert have nullability warnings.

Originator:steipete
Number:rdar://21291279 Date Originated:08-Jun-2015 03:57 PM
Status:Open Resolved:
Product:iOS Product Version:9.0b1
Classification:Other Bug Reproducible:Always
 
Summary:
Standard Objective-C assertions have nullability warnings. This is probably just an oversight of the first beta.

This can be fixed by updating the macro:

	    [[NSAssertionHandler currentHandler] handleFailureInFunction:__assert_fn__ \
		file:[NSString stringWithUTF8String:__FILE__] \

stringWithUTF8String is now annotated to return a nullable string; while NSAssertionHandler’s file: wants a nonnull object. In that case a cast is probably an acceptable fix.

Can be easily reproduced by adding NSC[Parameter]Assert’s to a function.

Screenshot: https://twitter.com/steipete/status/608045209163726848

Duplicates

Number Status Originator Product Title
rdar://21374118 Duplicate/21291279 jtbandes NSCAssert produces warning under -Wnullable-to-nonnull-conversion

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!