Skip to content

fix(tests): break up Bézier expressions that time out Swift type-checking#9

Merged
funsaized merged 1 commit into
mainfrom
fix/screen-outline-tests-typecheck
Jul 5, 2026
Merged

fix(tests): break up Bézier expressions that time out Swift type-checking#9
funsaized merged 1 commit into
mainfrom
fix/screen-outline-tests-typecheck

Conversation

@funsaized

Copy link
Copy Markdown
Owner

Problem

CI on main has been red since #8 landed: the PowerSnekKitTests target fails to compile on the macos-15/arm64 runner (Xcode 26.3, Swift 6 mode), so testing is cancelled before any test runs.

Tests/PowerSnekKitTests/ScreenOutlineTests.swift:109:5: error: the compiler is
unable to type-check this expression in reasonable time; try breaking up the
expression into distinct sub-expressions
    path.applyWithBlock { el in

The flattenedPoints helper's closure contains long chained quad/cubic Bézier arithmetic that mixes untyped integer literals with CGFloat (e.g. mt * mt * mt * p0.x + 3 * mt * mt * t * c1.x + …). Inside a closure with inferred parameter types, the constraint solver explores a combinatorial number of overloads for */+ and exceeds its time budget.

Fix

Hoist the sampling math into quadPoint/cubicPoint helpers with explicitly CGFloat-typed coefficient locals, exactly as the diagnostic suggests. The closure branches now just call the helpers. No behavior change.

Verification

Ran the same command CI uses (xcodebuild test -project PowerSnek.xcodeproj -scheme PowerSnek -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO): the test target compiles and all 41 tests pass, including the 7 ScreenOutlineTests.

🤖 Generated with Claude Code

…king

CI on main fails compiling ScreenOutlineTests.swift under Xcode 26.3:
"the compiler is unable to type-check this expression in reasonable
time" at the applyWithBlock closure in flattenedPoints. The chained
quad/cubic Bézier arithmetic mixing untyped integer literals with
CGFloat inside an inferred closure blows the type-checker's budget.

Hoist the sampling math into quadPoint/cubicPoint helpers with
explicitly typed CGFloat coefficients, as the diagnostic suggests.
No behavior change; all 41 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
power-snek Ready Ready Preview, Comment Jul 5, 2026 5:56pm

@funsaized
funsaized merged commit d52b021 into main Jul 5, 2026
7 checks passed
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