-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Closed
Copy link
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionArea → source tooling: code completionsource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source tooling
Description
| Previous ID | SR-7046 |
| Radar | rdar://problem/45340583 |
| Original Reporter | @AnthonyLatsis |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Attachment: Download
Environment
Xcode Version 9.2 (9C40b)
Additional Detail from JIRA
| Votes | 3 |
| Component/s | CodeCompletion |
| Labels | Bug |
| Assignee | @rintaro |
| Priority | Medium |
md5: 2666fe154a7afbbb66b70fdd218be9a2
relates to:
- SR-9027 SourceKit suggests autocomplete for unavailable constrained methods
- SR-9396 Nonsensical error message related to constrained extensions
Issue Description:
On the screenshot, `foo` can't be called on b, and the compiler will rightly show an error if I hit enter on the Autocomplete suggestion below.

I am not sure if Autocomplete is currently meant to be this smart, but if by any chance it is, here you go.
Another example:
extension Array {
func foo(...) where Element == Int { ... }
// This method will also always be visible in code completion, regardless of what type Element is
} Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionArea → source tooling: code completionsource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source tooling