-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed as duplicate of#63877
Closed as duplicate of#63877
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.compilerThe Swift compiler itselfThe Swift compiler itselfexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesparameterized protocolsFeature → protocol: protocols with primary associated typesFeature → protocol: protocols with primary associated typesprotocol compositionsFeature → types: protocol composition typesFeature → types: protocol composition typesswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected errorBug: Unexpected errorBug: Unexpected error
Description
The following doesn’t compile. I would expect it to. Otherwise I don’t see any way of specifying any kind of String collection that’s sendable.
let x: any Collection<String> & Sendable = [] // error: Non-protocol, non-class type 'Collection<String>' cannot be used within a protocol-constrained typerdar://132374933
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.compilerThe Swift compiler itselfThe Swift compiler itselfexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesparameterized protocolsFeature → protocol: protocols with primary associated typesFeature → protocol: protocols with primary associated typesprotocol compositionsFeature → types: protocol composition typesFeature → types: protocol composition typesswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected errorBug: Unexpected errorBug: Unexpected error