[Fix] Generic Parameter Shadow Warning with Swift 5.9 #67
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.
With the release of Xcode 15 we now have Swift 5.9. With that there comes a new warning about shadowing generic parameters, see swiftlang/swift#62767. There is one place in this repository affected:
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!