Compiler rejects protocol compositions involving protocols with primary associated types, but only for existentials #81295
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
I wanted to write the type
any Foo<Int> & Bar
, whereFoo
is a protocol with a primary associated type andBar
is another protocol. For some reason the compiler disallows this withany
but allows it withsome
.For example, this function is okay:
But this isn't
Similarly:
Reproduction
Expected behavior
Expect that
any
andsome
are supported equally when it comes to the constraints they are attached to, and more specifically thatany Foo<Int> & Bar
is allowed.Environment
Swift version 6.2-dev (LLVM 978186dad468cc4, Swift 2d7b7a7)
Target: x86_64-unknown-linux-gnu
Additional information
No response
The text was updated successfully, but these errors were encountered: