-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
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 completionexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valueslet & varFeature: constant and variable declarationsFeature: constant and variable declarationssource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingstatic declarationsFeature → declarations: Static declarationsFeature → declarations: Static declarationstypesFeature: typesFeature: typesunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Consider this:
protocol TestProtocol { }
struct TestImpl: TestProtocol { }
extension TestProtocol where Self == TestImpl {
static var impl: TestImpl {
TestImpl()
}
}
func someTestProtocol(value: some TestProtocol) { }
func anyTestProtocol(value: any TestProtocol) { }
For the some
variant, you get some useful completion:
But for the any
variant, you don't:
As a workaround you can use the some
variant in the API and just pass it down to the any
variant.
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 completionexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valueslet & varFeature: constant and variable declarationsFeature: constant and variable declarationssource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingstatic declarationsFeature → declarations: Static declarationsFeature → declarations: Static declarationstypesFeature: typesFeature: typesunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output