Repository navigation
Conversation
Xcode 26.2 (Swift 6.2.3) rejects MacImage.rotate() with "type of expression is ambiguous without a type annotation": the multi-statement closure passed to render() mixes CGFloat and Double. Any new app that links react-native-nitro-image on macOS failed to build. Convert the rotated bounds to Double and type the closure parameter so the type checker no longer has to infer them.
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.
Why
A new Spark app created from
mainfails to build its macOS dev build on Xcode 26.2 (Swift 6.2.3):macos/MacImage.swiftis not upstream code: Spark'spatches/camera/react-native-nitro-image.patchcreates it. Inrotate(), the multi-statement closure passed torender()mixesCGFloat(the rotatedCGRectbounds) andDouble(the image size), and Swift 6.2's type checker gives up on inferring it. The Kitchen Sink does not link NitroImage, so its builds did not catch it.What
Doubleand capture the source size before the closure.CGContext.+1,183to+1,185).Same rotation math, only explicit types.
Verification
diffpackage (whichnative-patches.cjsuses to apply patches) applies the updated patch to an empty file, and the output matches the hand-fixed file byte for byte.spark build --dev --platform macosof a freshspark create --universalapp (packed frommain) fails without the fix and builds with it, on Xcode 26.2.Not verified: an older Xcode such as CI's
macos-latest. The change only adds explicit types, so it should still compile there, and CI covers it.🤖 Generated with Claude Code