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

Only write @frozen on public interfaces #587

Closed
wants to merge 1 commit into from

Conversation

IanHoar
Copy link

@IanHoar IanHoar commented Jul 10, 2024

Motivation

Fixes a new warning in Xcode 16: @frozen has no effect on non-public enums

Modifications

When rendering enums, first check if the frozen modifier is required, then check if the access modifier is explicitly public. If both conditions are satisfied, render the @frozen modifier

Result

Frozen modifier will be in tact for public enums, but omitted for all other access levels

Test Plan

Integrated into my app, checked the warnings and they were fixed.

Before After
Screenshot 2024-07-10 at 9 37 18 AM Screenshot 2024-07-10 at 9 39 50 AM

Fixes a new warning in Xcode 16: `@frozen has no effect on non-public enums`
@czechboy0
Copy link
Contributor

czechboy0 commented Jul 10, 2024

Thanks @IanHoar! Can you also try with the package access modifier? Does it produce a warning and should also be included in this condition or not?

@czechboy0
Copy link
Contributor

Already addressed in #595

@czechboy0 czechboy0 closed this Jul 22, 2024
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