That was the original plan, but the decision was later reverted. The any P
syntax will not be required for existentials in the Swift 6 language mode.
Holly Borla, Progress toward the Swift 6 language mode (2023-11-07):
The Language Steering Group has decided that one previously-accepted upcoming feature,
ExistentialAny
, will not be enabled by default in Swift 6. SE-0335: Introduce existentialany
introduces theany
keyword to identify existential types. The proposal also specifies that "bare" protocol names will no longer be permitted as types---they must either useany
orsome
, as appropriate---under the upcoming feature flagExistentialAny
. Given the concerns about migration to consistent use of existentialany
in the language, and the expectation that additional language improvements will be coming that might affect the end result of that migration, the Language Steering Group is deferring the source-incompatible changes in SE-0335 to a future language revision.
I would still suggest getting into the habit of writing any P
everywhere because it's the better syntax IMO:
- One consistent spelling for all existentials
- Using different spellings for when a protocol is used as a constraint (no
any
) vs. when it's used as an existential is a good thing - Nice congruence between the
any P
andsome P
spellings, which can be used in similar places (though note that there have been discussions to make the plainP
spelling actually meansome P
in a future language version becausesome P
should generally be preferred unless you explicitly needany P
)