Skip to content

Fix AsyncAlgorithms 1.3 availability macro typo - #453

Open
PedroTessaro wants to merge 1 commit into
apple:mainfrom
PedroTessaro:fix-availability-macro-v1-3-typo
Open

Fix AsyncAlgorithms 1.3 availability macro typo#453
PedroTessaro wants to merge 1 commit into
apple:mainfrom
PedroTessaro:fix-availability-macro-v1-3-typo

Conversation

@PedroTessaro

Copy link
Copy Markdown

Fixes #452.

The #else branch of the availability macro block declared AsyncAlgorithms_v1_3 with the macro name AsyncAlgorithms 1.2. So on that path the macro AsyncAlgorithms 1.2 gets defined twice and AsyncAlgorithms 1.3 never gets defined at all. The #if branch above it, and Package@swift-5.8.swift, both have it right, so this looks like a copy/paste slip.

It isn't unused: AsyncAlgorithms 1.3 is referenced in Sources/AsyncAlgorithms/FlatMapLatest/ (AsyncFlatMapLatestSequence.swift, FlatMapLatestStorage.swift, FlatMapLatestStateMachine.swift).

One thing worth a second opinion while you're looking at this. I'm not sure the #else branch is reachable any more. Package.swift is swift-tools-version: 6.2, and there's a separate Package@swift-5.8.swift for older toolchains, so anything that can read this manifest should also satisfy compiler(>=6.0) && swift(>=6.0) and take the #if. The comment on line 7 about 5.10 and visionOS availability reads like a leftover from when the main manifest was on a lower tools version. If that's right, the whole conditional could go and just keep the visionOS variants. Happy to do that in this PR instead if you'd prefer, I just didn't want to bundle a bigger change into a typo fix.

swift build is clean before and after.

The `#else` branch declared `AsyncAlgorithms_v1_3` with the macro name
`AsyncAlgorithms 1.2`, so that branch defined `AsyncAlgorithms 1.2` twice
and never defined `AsyncAlgorithms 1.3`.

Issue: apple#452
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.

Possible typo for AsyncAlgorithms_v1_3 in Package.swift

1 participant