-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Sema/SIL] InitAccessors: Support default initialization of init accessor properties #67294
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
xedin
merged 10 commits into
swiftlang:main
from
xedin:default-init-via-accessor-in-custom-initializers
Jul 19, 2023
Merged
[Sema/SIL] InitAccessors: Support default initialization of init accessor properties #67294
xedin
merged 10 commits into
swiftlang:main
from
xedin:default-init-via-accessor-in-custom-initializers
Jul 19, 2023
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 |
d9cbc79
to
1593a14
Compare
@swift-ci please test |
@swift-ci please test Windows platform |
jckarter
approved these changes
Jul 18, 2023
…SILGenFunction This is a preliminary step towards enabling default initialization of init accessor properties in user-defined initializers because this logic would have to be shared by multiple places during SILGen.
Instead of taking a setter type, let's switch over to a more general `AccessorKind` which allows us to cover init accessors and simplify `emitApplySetterToBase`.
…eparate method New method is going to be used to emit default value initializations for user-defined constructors.
…xpressions Similar to regular stored properties emit initialization expressions for properties with init accessors at constructor's prolog.
…nitialization of stored properties Default expression associated with an init accessor property should always subsume that of any property listed in "initializes".
…about init accessors If stored property is covered by one or more init accessor property, it's default initializable when at least one of the init accessor properties has default value.
…inBorrowOperation returns back original value Calling `emitBeginBorrowOperation` on something which is `load_borrow` for example with guaranteed ownership doesn't produce `begin_borrow` instruction, so we need to be careful not to emit mismatched `end_borrow` in such cases.
… with DI data structures DI cares only about stored fields of the current type but `SILModule::getFieldIndex` goes through all of the supertypes as well.
…ass properties `super.init()` should fully initialize "super" which means that such properties are mutated via a setter.
1593a14
to
ff19286
Compare
@swift-ci please test |
hborla
approved these changes
Jul 19, 2023
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.
init()
) about init accessors (even if a stored property doesn't have an initializer expression, the compiler needs to check whether init accessor property that handles it does).Resolves: rdar://112417250