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-9938] Auto-Complete gets confused with overloads in constrained extensions #52344

Closed
jeremyabannister opened this issue Feb 16, 2019 · 6 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@jeremyabannister
Copy link

Previous ID SR-9938
Radar rdar://problem/48604807
Original Reporter @jeremyabannister
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug
Assignee @rintaro
Priority Medium

md5: 61ab8fb78e6954d7e071a2aedb0401a6

Issue Description:

enum Fruit     { case apple }
enum Vegetable { case broccoli }
enum Meat      { case chicken }


protocol EatsFruit      { }
protocol EatsVegetables { }
protocol EatsMeat       { }


struct Chef <Client> { }


extension Chef where Client: EatsFruit {
    func cook (_ food: Fruit) { }
}
extension Chef where Client: EatsVegetables {
    func cook (_ food: Vegetable) { }
}
extension Chef where Client: EatsMeat {
    func cook (_ food: Meat) { }
}


struct Vegetarian: EatsFruit, EatsVegetables { }




func demo () {
    let gordon = Chef<Vegetarian>()
    // gordon.cook()

    // Uncomment the line above and type a `.` in between the parentheses of cook(). My Xcode version is Version 10.2 beta (10P82s) and autocomplete shows me "apple", "broccoli" and "chicken" when it should only show me "apple" and "broccoli". 
}
@jeremyabannister
Copy link
Author

@benlangmuir @belkadan does this have any relation to this one that I reported? https://bugs.swift.org/browse/SR-9073?filter=-2

@benlangmuir
Copy link
Member

I think it's a different issue specific to overloading. It appears to be fixed in the latest development snapshot (swift-DEVELOPMENT-SNAPSHOT-2019-02-14-a).

@rintaro could you mention the PR that fixed this and update the radar link?

@jeremyabannister
Copy link
Author

@benlangmuir @rintaro

I just downloaded the latest Xcode 10.2 beta (Version 10.2 beta 3 (10P99q)) and this issue still exists with it. Is that expected?

@rintaro
Copy link
Mannequin

rintaro mannequin commented Mar 5, 2019

Sorry, this hasn't been fixed yet.

@jeremyabannister
Copy link
Author

@rintaro Do you have an idea of how this fits into the schedule and when it might be fixed? It seems trivial, but for the framework I'm developing it's actually the life blood of the workflow

@rintaro
Copy link
Mannequin

rintaro mannequin commented Apr 1, 2019

Ah, sorry for not reporting here.
This has been fixed in #23345 . It should be included swift-5.1-branch.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
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. code completion Area → source tooling: code completion source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

3 participants