Skip to content

Document why having a user defined protocol return type is often a problem #5031

@ilevkivskyi

Description

@ilevkivskyi

I have seen this proposed sometimes. We should explicitly say that protocols are good for argument types, but are bad for return types, because protocol is never a subtype of a concrete type (with an example). Typically even a union is better than protocol for a return type (which is itself quite bad, see #1693)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions