Skip to content

fix(ios): qualify enum cases for newer Swift compilers#1467

Open
ThnxFredrik wants to merge 1 commit intoauth0:masterfrom
ThnxFredrik:fix/swift-enum-ambiguity
Open

fix(ios): qualify enum cases for newer Swift compilers#1467
ThnxFredrik wants to merge 1 commit intoauth0:masterfrom
ThnxFredrik:fix/swift-enum-ambiguity

Conversation

@ThnxFredrik
Copy link

@ThnxFredrik ThnxFredrik commented Mar 25, 2026

Changes

This change updates ios/NativeBridge.swift to explicitly qualify a small number of enum cases that are ambiguous on newer Swift compilers.

Changed cases:

  • WebAuthError.other in WebAuthError.reactNativeErrorCode()
  • DPoPError.other in DPoPError.reactNativeErrorCode()
  • DPoPError.unknown in DPoPError.reactNativeErrorCode()

Why this is important:

  • On newer Apple toolchains, the unqualified .other and .unknown cases fail to compile with errors such as ambiguous use of 'other' and ambiguous use of 'unknown'.
  • This prevents iOS builds from succeeding for consumers using newer Xcode / Swift versions.
  • The change is intentionally minimal and does not alter runtime behavior. It only makes the enum pattern matching explicit for the compiler.

Public API:

  • No public API changes
  • No endpoint changes
  • No UI changes

References

Public references:

Non-public / local reproduction:

  • Reproduced in a downstream React Native + Expo app using:
    • react-native-auth0@5.4.0
    • Xcode 26.4
    • Apple Swift 6.3

If an issue is opened for this bug, it can be added here as well.

Testing

How reviewers can test:

  1. Check out this branch
  2. Install dependencies
  3. Build the iOS target using a recent Xcode / Swift toolchain
  4. Confirm that NativeBridge.swift no longer fails with ambiguous enum case errors for .other / .unknown

Tested locally:

  • Reproduced the compiler failure in a downstream app using Xcode 26.4 / Swift 6.3
  • Verified that this change fixes the downstream iOS build
  • This is a compiler-compatibility fix rather than a runtime behavior change

Limitations:

  • 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:

  • This change does not introduce new runtime logic; it resolves a compile-time ambiguity on newer Swift compilers.

Notes:

  • yarn lint reports existing warnings unrelated to this change:
    • src/core/utils/deepEqual.ts (eqeqeq)
    • src/plugin/withAuth0.ts (@typescript-eslint/no-shadow)
  • This PR does not touch those files.

Checklist

@ThnxFredrik ThnxFredrik requested a review from a team as a code owner March 25, 2026 14:21
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.

1 participant