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-12382] Poor diagnostic for type mismatch in pointer conversion to double optional #54818

Closed
hamishknight opened this issue Mar 19, 2020 · 2 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 good first issue Good for newcomers type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-12382
Radar rdar://problem/60832855
Original Reporter @hamishknight
Type Bug
Status Closed
Resolution Done
Environment

Swift version 5.3-dev (LLVM 0704986, Swift cd7bc73)
Target: x86_64-apple-darwin18.5.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug, TypeChecker
Assignee @hamishknight
Priority Medium

md5: 35cd3e6ba09c9ee8447375f1e5f2a45c

Issue Description:

The following produces an unhelpful diagnostic:

func takesMutableDoubleOptionalTypedPtr(_ x: UnsafeMutablePointer<Double>??) {}

var i = 0
takesMutableDoubleOptionalTypedPtr(&i) // error: type of expression is ambiguous without more context

We should instead point out that there's a type mismatch between Int and Double.

@beccadax
Copy link
Contributor

@swift-ci create

@xedin
Copy link
Member

xedin commented Mar 25, 2020

Fixed by #30627 Please verify using the next available master snapshot.

@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 good first issue Good for newcomers type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants