Skip to content

[Frontend][Parse] Parse new named opaque return type syntax #38041

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

Merged
merged 4 commits into from
Jun 25, 2021

Conversation

willtunnels
Copy link

First commit in the process of implementing the proposal for named opaque return types and associated 'where' clause support. See discussion here: https://forums.swift.org/t/improving-the-ui-of-generics/22814.

In order to put constraints on opaque types in function returns, we want to
support naming them like 'func f() -> <T> T { }'. This commit parses that
syntax into the new `OpaqueReturnParameteriedTypeRepr`. This is hidden behind
the new flag --enable-experimental-opaque-return-types.
@willtunnels willtunnels requested a review from slavapestov June 23, 2021 00:07
@willtunnels
Copy link
Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d2de21a

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d2de21a

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great start!

@willtunnels willtunnels requested a review from slavapestov June 24, 2021 01:40
- Allow named opaque types in typed patterns and subscripts
- Fix inheritance clause printing for `GenericParamList`
- clang-format changes from previous commit on this branch
@willtunnels willtunnels requested a review from slavapestov June 24, 2021 15:15
Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ready to merge, except for the var/subscript decl tests I mentioned.

@willtunnels
Copy link
Author

@swift-ci please smoke test

@willtunnels willtunnels merged commit 214f480 into swiftlang:main Jun 25, 2021
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.

3 participants