Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-2928] Collection casts from collections of optionals to collections of Any need custom handling #45522

Closed
rudkx opened this issue Oct 12, 2016 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@rudkx
Copy link
Member

rudkx commented Oct 12, 2016

Previous ID SR-2928
Radar None
Original Reporter @rudkx
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee @hamishknight
Priority Medium

md5: 343ed5a8a2671897104288f18d766e37

relates to:

  • SR-2921 Some implicitly coerced from to Any warnings missing a source location

Issue Description:

Currently for a collection cast from something like [Int?] to [Any] we emit warnings without a source location (SR-2921).

We also emit a misleading warning (complaining about the element types, not the collection types), and bogus fixits that are not only the wrong thing to do, but don't actually silence the warning (in the case of the 'as Any') case.

I am going to fix the source location issue now, but we need to come back and make a custom warning for this and fix the fixits.

@belkadan
Copy link
Contributor

Is this the same as SR-2921?

@rudkx
Copy link
Member Author

rudkx commented Oct 12, 2016

No as I mention in the description I'm going to fix the source location information called out in SR-2921, but doing that doesn't fix the more general issue that the warnings aren't ideally, and the fixits are broken. I don't have time to fix that at the moment, but at least fixing the source location will make it possible for people to know where these are coming from.

@hamishknight
Copy link
Collaborator

#14221

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants