Repository navigation
implicit_optional_initialization: add ignore_attributes support - #6513
Merged
SimplyDanny merged 4 commits intoFeb 28, 2026
Merged
SimplyDanny merged 4 commits into
SimplyDanny merged 4 commits into
Conversation
Closed
2 tasks done
Generated by 🚫 Danger |
SimplyDanny
reviewed
Feb 27, 2026
SimplyDanny
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the fix! What about the never style for which auto-correction would add a = nil.
Contributor
Author
|
Thanks for the catch on I pushed 1da5182 to apply |
Contributor
Author
|
Follow-up fix for the failing Registration step:
Commit: d9e7257 |
SimplyDanny
requested changes
Feb 28, 2026
SimplyDanny
left a comment
Collaborator
There was a problem hiding this comment.
Looks good now! However, you need to make sure the rewriter applies the same logic.
Contributor
Author
|
Thanks for calling this out. I added explicit correction coverage to ensure the rewriter follows
I also ran: and it passes locally. |
SimplyDanny
approved these changes
Feb 28, 2026
SimplyDanny
enabled auto-merge (squash)
February 28, 2026 10:41
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
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.
Summary
Adds a targeted escape hatch for
implicit_optional_initializationwhen explicit= nilis required by specific wrappers/attributes.Fixes #3998.
What changed
ignore_attributesconfiguration toimplicit_optional_initialization.style: always).Why
Some property wrappers/attributes require explicit optional initialization (
= nil) to compile.A previous broad approach (skip all custom attributes) was too permissive. This keeps behavior explicit and configurable.
Validation
swift test --filter ImplicitOptionalInitializationRuleGeneratedTestsExample config