fix(ios): qualify enum cases for newer Swift compilers#1467
Open
ThnxFredrik wants to merge 1 commit intoauth0:masterfrom
Open
fix(ios): qualify enum cases for newer Swift compilers#1467ThnxFredrik wants to merge 1 commit intoauth0:masterfrom
ThnxFredrik wants to merge 1 commit intoauth0:masterfrom
Conversation
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.
Changes
This change updates
ios/NativeBridge.swiftto explicitly qualify a small number of enum cases that are ambiguous on newer Swift compilers.Changed cases:
WebAuthError.otherinWebAuthError.reactNativeErrorCode()DPoPError.otherinDPoPError.reactNativeErrorCode()DPoPError.unknowninDPoPError.reactNativeErrorCode()Why this is important:
.otherand.unknowncases fail to compile with errors such asambiguous use of 'other'andambiguous use of 'unknown'.Public API:
References
Public references:
react-native-auth0repository: https://github.com/auth0/react-native-auth0Non-public / local reproduction:
react-native-auth0@5.4.026.46.3If an issue is opened for this bug, it can be added here as well.
Testing
How reviewers can test:
NativeBridge.swiftno longer fails with ambiguous enum case errors for.other/.unknownTested locally:
26.4/ Swift6.3Limitations:
I validated this through downstream integration rather than this repository’s full test/build matrix
No unit tests were added because this is a compiler-compatibility fix in Swift switch matching, not a behavioral change
This change adds unit test coverage
This change has been tested on the latest version of the platform/language or why not
Reason not checked for unit coverage:
Notes:
yarn lintreports existing warnings unrelated to this change:src/core/utils/deepEqual.ts(eqeqeq)src/plugin/withAuth0.ts(@typescript-eslint/no-shadow)Checklist