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-9978] SourceKit doesn't respect type restriction of an extension #52382

Closed
swift-ci opened this issue Feb 22, 2019 · 4 comments
Closed

[SR-9978] SourceKit doesn't respect type restriction of an extension #52382

swift-ci opened this issue Feb 22, 2019 · 4 comments
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

@swift-ci
Copy link
Collaborator

Previous ID SR-9978
Radar None
Original Reporter vojta_stavik (JIRA User)
Type Bug
Status Closed
Resolution Duplicate

Attachment: Download

Environment

Swift 5 @ Xcode 10.2b3 (10P99q)
Swift 4.2 @ Xcode 10.1 (10B61)

Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug
Assignee None
Priority Medium

md5: da61629a1215dbffee9f213dbe927bd2

duplicates:

  • SR-9027 SourceKit suggests autocomplete for unavailable constrained methods

Issue Description:

I have the following code:

struct Box<Type> { }

enum Cat { }
enum Dog { }

extension Box where Type == Cat {
  func getCat() -> Box<Cat> { return self }
}

extension Box where Type == Dog {
  func getDog() -> Box<Dog> { return self }
}

let catBox: Box<Cat> = .init()

The autocompletion on catBox incorrectly offers both getCat() and getDog() methods.

cat.getDog() of course fails to compile because "'Box<Cat>' is not convertible to 'Box<Dog>'".

@belkadan
Copy link
Contributor

Looks a lot like SR-9938, but this one's apparently not fixed in 10.2b3. @rintaro?

@rintaro
Copy link
Mannequin

rintaro mannequin commented Feb 22, 2019

This is actually SR-9029. Thanks for reporting! I'll fix this ASAP.

@rintaro
Copy link
Mannequin

rintaro mannequin commented Feb 22, 2019

I meant SR-9027.

@swift-ci
Copy link
Collaborator Author

Comment by Vojta Stavik (JIRA)

Thank you Rintaro!

@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