-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AST/Sema] TypeWrappers: Extend implementation to support wrapped type #61501
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
Conversation
This file contains hidden or 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 |
1 similar comment
@swift-ci please test |
a6e4203
to
534d0fb
Compare
@swift-ci please smoke test |
534d0fb
to
7d79941
Compare
@swift-ci please smoke test |
7d79941
to
6ff225d
Compare
@swift-ci please smoke test |
This parameter should be the first in the list of generic parameters. `for: Wrapped.Type` parameter is added to a required initializer.
…ss the wrapped type
…per subscripts The compiler is going to synthesize `\.<property-name>` as an argument to `propertyKeyPath:` parameter which points to the wrapped property.
…lasses New subscript allows to pass wrapped self instance down to the type wrapper and is declared as follows: ``` subscript<...>(wrappedSelf <name>: Wrapped, propertyKeyPath: ..., storageKeyPath: ...) ``` The type-checker would use it to synthesize getter/setter accessors for managed storage if wrapped type is a class.
Make sure that memberwise initializer body doesn't force other synthesis by emitting it lazily. Resolves: rdar://99884355
…torageWrapper: <Wrapper>)` If there are no type wrapper ignored stored properties, the compiler would synthesize a special public initializer that allows to initialize a wrapped type by providing a fully initialized wrapper instance.
Some of the key paths are printed inconsistently across different platforms.
6ff225d
to
a82d8a5
Compare
@swift-ci please smoke test |
@swift-ci please test |
hborla
approved these changes
Oct 26, 2022
@swift-ci please smoke test |
@swift-ci please clean smoke test macOS platform |
@swift-ci please clean smoke test Linux platform |
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.
storage:
$storage
Wrapped
type parameter requirementpropertyKeyPath
parameter to type wrapper subscriptssubscripts are going to have both wrapped property and storage references -
propertyKeyPath:storageKeyPath:
For wrapped classes allow to declare a special subscript that allows to pass down wrapped type instance.
Resolves: rdar://99884355