[SR-11022] [Opaque Result Types] definition in protocols allowed but error in protocol implementation #53412
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
conformances
Feature → protocol: protocol conformances
opaque types
Feature → types: opaque types
Additional Detail from JIRA
md5: 0d1957e9924647428567b18a8bbe6ce5
Issue Description:
It is currently allowed by the compiler to define variables having opaque result types, but creating objects conforming these protocols generates a compiler error.
Example:
Nt sure if the bug is in the fact that protocols should not allow the definition of opaque pointers to avoid associated types or in the fact that the compiler is wrongfully erroring a legitimate conformance... either ways there is something wrong here.
In the first case, the compiler should not allow the definition of var barvar: some Foo { get } in the protocol.
In the second case, Baz should be considered conformant to Bar as it fullfils all the requirements.
The text was updated successfully, but these errors were encountered: