Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow protocol composition types everywhere #51

Merged
merged 1 commit into from
Nov 20, 2021

Conversation

alex-pinkus
Copy link
Owner

The grammar suggests that protocol composition types are only allowed "when
specifying a type in type annotations, in generic parameter clauses, and in
generic where clauses." The corpus of valid code seems to imply
otherwise. Instead, we just allow these everywhere, and resolve
ambiguity the same way the compiler appears to by giving them right
precedence.

Fixes #46

Also bundled the one-liner fix for #50

The grammar suggests that protocol composition types are only allowed "when
specifying a type in type annotations, in generic parameter clauses, and in
generic where clauses." The corpus of valid code seems to imply
otherwise. Instead, we just allow these everywhere, and resolve
ambiguity the same way the compiler appears to by giving them right
precedence.

Fixes #46

Also bundled the one-liner fix for #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Protocol composition types should still be legal in a few more places
1 participant