-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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.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 typesprotocolFeature → type declarations: Protocol declarationsFeature → type declarations: Protocol declarationsswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Description
No response
Reproduction
Compiling the following program with -enable-upcoming-feature ExistentialAny
succeeds, even though it should fail since the constraint on f
's parameter is written as P2
instead of any P2
.
protocol P1<T> {
associatedtype T
}
protocol P2 {}
func f(_: some P1<P2>) {} // <---
Expected behavior
The compiler should (when compiling with the ExistentialAny flag on) require that existential be explicitly spelled with any
, as defined in SE-0335.
Environment
Apple Swift version 6.0-dev (LLVM 1ad249b55ef5cc0, Swift b10d97d)
Target: arm64-apple-macosx14.0
Additional information
No response
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 typesprotocolFeature → type declarations: Protocol declarationsFeature → type declarations: Protocol declarationsswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output