Skip to content
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

Remove memberwise initializers for AutomaticDirectiveConvertible types. #799

Conversation

d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable:

Summary

This removes the internal memberwise initializers for a few AutomaticDirectiveConvertible types.

Types that are AutomaticDirectiveConvertible aren't intended to be initialized directly. These initializers are unused.

Dependencies

None.

Testing

Build DocC. There shouldn't be any compiler errors.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • [ ] Added tests
  • Ran the ./bin/test script and it succeeded
  • [ ] Updated documentation if necessary

Types that are automatically convertible aren't intended to be initialized directly.
@d-ronnqvist d-ronnqvist added the code cleanup Code cleanup *without* user facing changes label Jan 15, 2024
Copy link
Contributor

@patshaughnessy patshaughnessy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I noticed there are a few subclasses of AutomaticDirectiveConvertible which still contain private member-wise initializers, such as PageImage and @Metadata. These are still needed for some reason and can't be removed also?

@d-ronnqvist
Copy link
Contributor Author

Looks good. I noticed there are a few subclasses of AutomaticDirectiveConvertible which still contain private member-wise initializers, such as PageImage and @Metadata. These are still needed for some reason and can't be removed also?

Correct. Both of those initializers need to exist for a workaround. They both have comments that explain why.

Note that #806 fixes the root cause that's the reason for that workaround and also removes those two initializers.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit d958114 into swiftlang:main Feb 1, 2024
2 checks passed
@d-ronnqvist d-ronnqvist deleted the remove-automatic-directive-convertible-initializers branch February 1, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Code cleanup *without* user facing changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants