-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[6.0][AST/Sema] Make it possible to use init accessors in inlinable initializers #75243
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 5 commits into
swiftlang:release/6.0
from
xedin:inlinable-init-accessors-6.0
Sep 3, 2024
Merged
[6.0][AST/Sema] Make it possible to use init accessors in inlinable initializers #75243
xedin
merged 5 commits into
swiftlang:release/6.0
from
xedin:inlinable-init-accessors-6.0
Sep 3, 2024
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
This allows them to be used across files in the same module and requires explicit `@usableFromInline` annotation to be used inside of `@_alwaysEmitIntoClient` and `@inlinable` initializers. (cherry picked from commit dbe151b)
…claration without a name (i.e. accessor/init) (cherry picked from commit 6925940)
…xts if they are not marked as `@usableFromInline` (cherry picked from commit 123068c)
Using init accessors from inlinable code requires `@usableFromInline` annotation, which means that we need to print them in swift interfaces and serialize them. (cherry picked from commit be33968)
@swift-ci please test |
(cherry picked from commit 115d26a)
@swift-ci please test |
@swift-ci please test |
This change is not targeting 6.0. I've converted this to a draft until we have a |
@swift-ci please test |
1 similar comment
@swift-ci please test |
hborla
approved these changes
Sep 3, 2024
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.
Explanation:
Fixes a SILGen crash-on-invalid when init accessors are referenced in inlinable initialzers without explicit
@usableFromInline
attribute.internal
@usableFromInline
on init accessor when property is used in a designated inlinable initializer@usableFromInline
is applied to a declaration without a name (i.e. accessor/init)Main Branch PR: [AST/Sema] Make it possible to use init accessors in inlinable initializers #75191
Resolves: rdar://129318806
Risk: Low (Diagnoses invalid code instead of crashing and allows more uses of init accessors in accordance with the proposal).
Reviewed By: @tshortli
Testing: Existing test-cases were modified and new tests were added.