Skip to content

[AST/Sema] Make it possible to use init accessors in inlinable initializers #75191

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
Jul 15, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jul 12, 2024

  • Make init accessors internal
  • Require explicit @usableFromInline on init accessor when property is used in a designated inlinable initializer
  • Improve diagnostics when @usableFromInline is applied to a declaration without a name (i.e. accessor/init)

Resolves: rdar://129318806

xedin added 2 commits July 11, 2024 14:03
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.
…claration without a name (i.e. accessor/init)
@xedin
Copy link
Contributor Author

xedin commented Jul 12, 2024

@swift-ci please test

@xedin xedin requested a review from jckarter July 12, 2024 00:21
@xedin xedin force-pushed the inlinable-init-accessors branch from aab34d9 to 2d9f5a7 Compare July 12, 2024 04:44
@xedin
Copy link
Contributor Author

xedin commented Jul 12, 2024

@swift-ci please test Linux platform

@xedin
Copy link
Contributor Author

xedin commented Jul 12, 2024

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jul 12, 2024

@swift-ci please test Windows platform

xedin added 2 commits July 12, 2024 09:54
…xts if they are not marked as `@usableFromInline`
Using init accessors from inlinable code requires `@usableFromInline`
annotation, which means that we need to print them in swift interfaces
and serialize them.
@xedin xedin force-pushed the inlinable-init-accessors branch from 2d9f5a7 to be33968 Compare July 12, 2024 16:58
@xedin
Copy link
Contributor Author

xedin commented Jul 12, 2024

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jul 15, 2024

@swift-ci please test macOS platform

@xedin xedin merged commit cfb50a0 into swiftlang:main Jul 15, 2024
5 checks passed
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.

2 participants