swift: [SR-7015] The CoreFoundation conditional downcast diagnostic is not as helpful as it should be

Previous ID SR-7015
Radar None
Original Reporter Anandabits (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee orakaro (JIRA)
Priority Medium

md5: 4c03f1e87c744b77d83845df192a1e31

Issue Description:

When the `as?` operator is used to target a CoreFoundation type the compiler produces a diagnostic which says “Conditional downcast to CoreFoundation type … will always succeed”. This does not offer any suggestions about what to do instead.

The diagnostic should be updated with a message that informs the developer to compare CFTypeIds (with a fixit if possible).

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 18 (15 by maintainers)

Most upvoted comments

I see this still happening in 2024…