Navigation Menu

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-13088] False positive warning "cast always fails" #55534

Closed
typesanitizer opened this issue Jun 26, 2020 · 3 comments
Closed

[SR-13088] False positive warning "cast always fails" #55534

typesanitizer opened this issue Jun 26, 2020 · 3 comments
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

@typesanitizer
Copy link

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

md5: c179929406293501a8ea74b137098356

Sub-Tasks:

  • SR-11434 False positive warning: cast always fails from 'Encodable' to 'NSDecimalNumber'/'[String: Encodable]'
  • SR-12321 False positive warning: cast always fails from 'Encodable' to '[String: Encodable]'
  • SR-13025 False positive warning: cast always fails from '(AnyEvent, AnyC)' to 'Container'
  • SR-13081 False positive warning: cast always fails from 'JSON' to '[Any]'
  • SR-13035 False positive warning: cast always fails from 'Result<String, ChildError1>' to 'Result<String, SomeError>'
  • SR-7187 False positive warning: cast always fails from '[Any]' to '[String?]'
  • SR-6192 Spurious "Cast from ... to unrelated type ... always fails" warning when implicitly converting an empty collection

Issue Description:

This is an umbrella JIRA for several other JIRAs.

  1. https://bugs.swift.org/browse/SR-11434

  2. https://bugs.swift.org/browse/SR-12321

  3. https://bugs.swift.org/browse/SR-13025

  4. https://bugs.swift.org/browse/SR-13035

  5. https://bugs.swift.org/browse/SR-13081

  6. https://bugs.swift.org/browse/SR-7187

  7. https://bugs.swift.org/browse/SR-6192

@typesanitizer
Copy link
Author

Ping @LucianoPAlmeida: you might want to look at all of these together before starting to tackle SR-13081 which you signed up for. 🙂

@LucianoPAlmeida
Copy link
Collaborator

theindigamer (JIRA User) Sure, I'll look it up 🙂
Also, I believe that SR-7187 could be grouped here too. In fact, maybe is a dupe of the JSON to '[Any]' can we add here?

@typesanitizer
Copy link
Author

Thanks, I missed that one. It's not super clear whether SR-7187 is a dupe, as one of the comment notes that it only happens when optionals are involved. So I've added it as a sub-task for now.

@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

2 participants