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: add missing switch cases and update compiler check #457

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

Conversation

juliansteenbakker
Copy link
Contributor

Fixes warning during build about switch case not being exhaustive

@tp
Copy link
Collaborator

tp commented Jan 21, 2025

@juliansteenbakker Thanks, I'll look into this and see what we can do.

Could you please rebase this onto master so we get a working CI (sorry, that was just merged from our end). Then we can also ensure that all supported/checked Xcode versions are properly working.

.github/workflows/dart.yml Outdated Show resolved Hide resolved
@@ -61,15 +61,17 @@ jobs:
matrix:
os: [macos-13, macos-14, macos-15]
package: [sign_in_with_apple/sign_in_with_apple]
xcode: ["14.3.1", "15.2", "16.0"]
xcode: ["14.3.1", "15.2", "16.1"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would like to use at least 16.1 and 16.2 (where the new case was added and what you check with compiler(>=6.0.3), right?).

I don't think we can expect users (and their CI) to always use the very latest Xcode version shortly after release, so we have to be sure to support the currently expected ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were not part of my original PR, but changes already merged in #456.

I have removed these changes from my PR, so now it should be correct.

As for the check, i think it would be good to also check for 16.2, so if wanted, i can add that to my PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the check, i think it would be good to also check for 16.2, so if wanted, i can add that to my PR.

Yes, that's what I would also suggest, given that the change you added (with that specific compiler version) will only be included in 16.2.

@juliansteenbakker juliansteenbakker force-pushed the fix/switch-case-exhaustive branch from 089071f to 41c3155 Compare January 21, 2025 14:51
@@ -107,15 +107,21 @@ public enum SignInWithAppleError {
errorCode = "authorization-error/notHandled"
case .failed:
errorCode = "authorization-error/failed"
#if (os(iOS) && swift(>=5.5)) || (os(macOS) && swift(>=5.5.1))
#if compiler(>=5.5)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this change needed? The old comment refers to this being shipped in different versions for iOS and macOS.

But overall I would not mind to change this, as we only support Xcode 14.3.1 (with Swift 5.8), so this will work on either OS with this check and that macOS version.

Just generally of the "don't fix what's not broken" camp here, as we don't know if there is not some user relying on this behavior because of a certain old Xcode version (though by now there might be 3 other changes that would've long prevented that one from using the latest version of this package, as we can not test every single combination).

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