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
Named opaque result types #40715
Merged
Merged
Named opaque result types #40715
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci please test |
Build failed |
@swift-ci please smoke test |
Address small gaps in several places to make named opaque result types partially work: * Augment name lookup to look into the generic parameters when inside the result type, which is used both to create structure and add requirements via a `where` clause. * Resolve opaque generic type parameter references to OpaqueTypeArchetypeType instances, as we do for the "some" types * Customize some opaque-type-specific diagnostics and type printing to refer to the opaque generic parameter names specifically * Fix some minor issues with the constraint system not finding already-opened opaque generic type parameters and with the handling of the opaque result type candidate set. The major limitation on opaque types, where we cannot add requirements that aren't strictly protocol or superclass requirements on the generic parameters, remains. Until then, named opaque result types are no more expressive than structural opaque result types.
Add lookup scopes for the generic parameters of a named opaque result type and clean up the code that finds the opaque substitutions.
DougGregor
force-pushed
the
named-opaque-result-types
branch
from
January 5, 2022 05:15
8256014
to
ef7df1d
Compare
@swift-ci please smoke test |
There's a bunch more work to do, but most of the hard part is representational changes that have little to do with named opaque result types, but need this to properly test. Merging now, since everything is still behind a flag. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement support for named opaque result types, e.g.,
this mostly involves wiring up name lookup and type resolution so we can find the generic parameters
when they are used.