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-11535] Generic ambiguous none case is not diagnosed #53936

Closed
theblixguy opened this issue Sep 27, 2019 · 7 comments
Closed

[SR-11535] Generic ambiguous none case is not diagnosed #53936

theblixguy opened this issue Sep 27, 2019 · 7 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 good first issue Good for newcomers type checker Area → compiler: Semantic analysis

Comments

@theblixguy
Copy link
Collaborator

Previous ID SR-11535
Radar rdar://problem/56056152
Original Reporter @theblixguy
Type Bug
Status Resolved
Resolution Done
Environment

Swift 5.1

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug, TypeChecker
Assignee maveric (JIRA)
Priority Medium

md5: 3440d3e720ac46459806c3e2a366f6c2

Issue Description:

The following code should trigger the ambiguous none warning, but doesn't:

enum Foo<T> {
  case bar
  static var none: Foo<Int> { .bar }
}

Expected:

let optionalFoo: Foo? = .none // warning: assuming you mean 'Optional<Foo>.none'; did you mean 'Foo<Int>.none' instead?

Actual

let optionalFoo: Foo? = .none // assigned Foo<Int>.none, instead of Optional.none

I am not sure why the solver is rejecting the Optional.none solution and going for Foo<Int>.none solution instead (maybe it's failing to bind T to a type?)

@theblixguy
Copy link
Collaborator Author

cc @xedin

@belkadan
Copy link
Contributor

Yeah, your guess is correct.

@xedin
Copy link
Member

xedin commented Oct 8, 2019

@swift-ci create

@swift-ci
Copy link
Collaborator

Comment by Ziyuan Zhao (JIRA)

Any advice about where to start fix this bug?

@swift-ci
Copy link
Collaborator

Comment by Vuk (JIRA)

Hi ninjiacoder (JIRA User) are you still working on this? If not I would like to try fixing this.

@swift-ci
Copy link
Collaborator

swift-ci commented Mar 6, 2020

Comment by Ziyuan Zhao (JIRA)

hi vukrado (JIRA User), of course you can. I still have no ideas how to fix this bug.

@LucianoPAlmeida
Copy link
Collaborator

Resolved by #34715 and #34744

@theblixguy can you verify on the latest snapshot and close? Thanks

@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

5 participants