swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.57k stars 10.35k forks source link

[SR-14220] Hide protocol requirements witnessed by "more generic" methods from autocomplete #56596

Open karwa opened 3 years ago

karwa commented 3 years ago
Previous ID SR-14220
Radar rdar://problem/74392495
Original Reporter @karwa
Type Improvement

Attachment: Download

Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | CodeCompletion | |Labels | Improvement | |Assignee | None | |Priority | Medium | md5: 9df225d1e3b8e4cff7e91c54c11b8888

Issue Description:

If I have a type which conforms to LosslessStringConvertible (LSC) via a generic initialiser on StringProtocol:

struct Foo: LosslessStringConvertible {
  init?<S>(_ description: S) where S: StringProtocol {}
  var description: String { "" }
}

Autocomplete will show both the generic initialiser that I wrote, and the non-generic initialiser from LSC. They both get documentation from the protocol requirement, and it feels like clutter to include both of them in the list.

typesanitizer commented 3 years ago

@swift-ci create