Nullability not considered when typeof is used to declare variable

Originator:marceljackwerth
Number:rdar://22895511 Date Originated:Developer Tools
Status:Open Resolved:
Product:Developer Tools Product Version:Version 7.0 (7A220)
Classification:Other Bug Reproducible:Always
 
Marcel Jackwerth29-Sep-2015 02:33 PM

Summary:
When I use typeof when declaring a variable LLVMs is unable to check implicit nullability conversions.

Steps to Reproduce:
1. Create project
2. Enable nullability checks
3. Add code to main method
      NSString *aString = @"Some String Here";
      __weak typeof(aString) __nullable weakString = aString;
      typeof(weakString) __nullable strongString = weakString;
      NSString *dummyResult = [NSString stringWithString:strongString];
      NSLog(@"Use variable: %@", dummyResult);

Expected Results:
Compiler should complain about implicit conversion from nullable to non-nullable type for [NSString stringWithString:strongString]`

Actual Results:
No warning emitted.

Workaround: Replacing typeof(weakString) with NSString *

Version:
Version 7.0 (7A220)

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!