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

[Fix] Generic Parameter Shadow Warning with Swift 5.9 #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FelixHerrmann
Copy link

With the release of Xcode 15 we now have Swift 5.9. With that there comes a new warning about shadowing generic parameters, see apple/swift#62767. There is one place in this repository affected:
Screenshot 2023-09-14 at 12 48 56

Implementation Details

It turns out that we don't need the generic parameter on this type at all, it's a private struct nested inside the type that already has the parameter defined, so there is no need to parse it through. Another approach would be to just rename the shadowed, inner parameter to something like V but IMO we should just remove it. Let me know if there are any concerns...

I have also fixed one failing test, the compare json had the opposite order compared to how it is defined in the CodingKeys.

Conclusion

This warning will be an error in Swift 6 so we should get that fix in, the sooner the better!

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.

None yet

1 participant