No warning when assigning array and dictionary literals with mismatched Objective-C generic types
| Originator: | heath.borders | ||
| Number: | rdar://25060756 | Date Originated: | 09-Mar-2016 10:58 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Version 7.2 (7C68) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
The compiler doesn’t warn when assigning an array or dictionary literal.
Steps to Reproduce:
Compile the following:
NSArray<NSString *> *noWarningStrings = @[@1,
@2,
@3,
];
NSDictionary<NSString *, NSString *> *noWarningStringsByString = @{@1 : @1,
@2 : @2,
@3 : @3,
};
NSLog(@"noWarningStrings: %@, noWarningStringsByString: %@",
noWarningStrings,
noWarningStringsByString);
Expected Results:
The compiler should warn about both assignments because the generic type of the literal doesn’t match the lvalue generic type.
Actual Results:
The compile emits no warnings.
Regression:
Notes:
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!