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-9027] SourceKit suggests autocomplete for unavailable constrained methods #51530

Closed
natecook1000 opened this issue Oct 17, 2018 · 2 comments
Assignees
Labels
code completion Area → source tooling: code completion improvement source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@natecook1000
Copy link
Member

Previous ID SR-9027
Radar rdar://problem/45340583
Original Reporter @natecook1000
Type Improvement
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 1
Component/s CodeCompletion
Labels Improvement
Assignee @rintaro
Priority Medium

md5: 631e20c126cec60b7f34909b9ca4c759

is duplicated by:

  • SR-9978 SourceKit doesn't respect type restriction of an extension

relates to:

  • SR-7046 Autocomplete suggests methods that can't be called on certain instances

Issue Description:

SourceKit is providing autocomplete suggestions for symbols that are constrained, but not allowed on a particular instance. For example:

struct Item<T> {}
enum A {}
enum B {}
extension Item where T == A {
    var a: String { return "a" }
}
extension Item where T == B {
    var b: String { return "b" }
}

If you create an instance of Item<A> and then use autocomplete to get the list of available symbols, it includes b when it shouldn't.

(As reported in: https://forums.swift.org/t/constrained-extensions-and-auto-completion/17115)

@natecook1000
Copy link
Member Author

@swift-ci create

@rintaro
Copy link
Mannequin

rintaro mannequin commented Mar 15, 2019

#23065

@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
code completion Area → source tooling: code completion improvement source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

2 participants