Skip to content

[5.9][Sema/SILGen] Omnibus of init accessor feature improvements #66715

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 1 commit into from
Jun 19, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 16, 2023

Cherry-pick of #66681, #66513

  • Explanation:

    Multitude of improvements to init accessors feature:

    • Diagnose standalone self within init accessors
    • Diagnose references to members not listed in initializes or accesses attributes within init accessors
    • Enforce that @out parameters are fully initialized before every terminator
    • Detect and don't synthesize memberwise initializer with intersecting init accessor calls
    • Diagnose situations when memberwise init cannot be synthesized due to use of not-yet-initialized properties
    • Allow initialization expressions when computed property has init accessor;
    • Synthesize default argument for init accessor property included in memberwise initializer.
  • Scope: Declarations and expression that define or use init accessors feature

  • Main Branch PRs: [Sema/SILGen] InitAccessors: Synthesize default arguments for init accessor properties #66681, [Sema/SIL] Improve diagnostics related to init accessors #66513

  • Risk: Very Low

  • Reviewed By: @hborla

  • Testing: Added regression test-cases to the suite.

- Diagnose standalone `self` within init accessors
- Diagnose references to members not listed in `initializes` or `accesses` attributes within init accessors
- Enforce that `@out` parameters are fully initialized before every terminator
- Detect and don't synthesize memberwise initializer with intersecting init accessor calls
- Diagnose situations when memberwise init cannot be synthesized due to use of not-yet-initialized properties
- Allow initialization expressions when computed property has init accessor;
- Synthesize default argument for init accessor property included in memberwise initializer.

(cherry picked from commit 5613006)
(cherry picked from commit 935142f)
(cherry picked from commit 3c924be)
(cherry picked from commit db024d9)
(cherry picked from commit f6fd0bc)
(cherry picked from commit ddcfe01)
(cherry picked from commit 4f59538)
(cherry picked from commit cffc3fd)
(cherry picked from commit 6ca9728)
(cherry picked from commit 34c8cf6)
(cherry picked from commit 8b1c9c9)
(cherry picked from commit d1554f2)
(cherry picked from commit fc895b4)
(cherry picked from commit f58d407)
@xedin xedin requested a review from hborla June 16, 2023 20:05
@xedin xedin requested a review from a team as a code owner June 16, 2023 20:05
@xedin xedin added swift 5.9 🍒 release cherry pick Flag: Release branch cherry picks labels Jun 16, 2023
@xedin xedin changed the title [Sema/SILGen] Omnibus of init accessor feature improvements [5.9][Sema/SILGen] Omnibus of init accessor feature improvements Jun 16, 2023
@xedin
Copy link
Contributor Author

xedin commented Jun 16, 2023

swiftlang/swift-syntax#1803
@swift-ci please test

@xedin xedin merged commit b74e531 into swiftlang:release/5.9 Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants