Skip to content

Add Sendable conformance to Point, Rect, and Size - #45

Merged
ctreffs merged 1 commit into
masterfrom
sendable
Aug 9, 2026
Merged

Add Sendable conformance to Point, Rect, and Size#45
ctreffs merged 1 commit into
masterfrom
sendable

Conversation

@ctreffs

@ctreffs ctreffs commented Aug 9, 2026

Copy link
Copy Markdown
Member

Description

Adds conditional Sendable conformance to Point, Rect, and Size when their underlying Value type conforms to Sendable. This allows instances of these geometric structs to be safely transferred across concurrency domains in Swift 5.5+ without triggering compiler warnings or requiring manual synchronization.

Summary of changes:

  • Sources/FirebladeMath/Point.swift: Added extension Point: Sendable where Value: Sendable {}
  • Sources/FirebladeMath/Rect.swift: Added extension Rect: Sendable where Value: Sendable {}
  • Sources/FirebladeMath/Size.swift: Added extension Size: Sendable where Value: Sendable {}

Detailed Design

Syntactically aligns with existing conditional protocol conformances (Equatable, Hashable, Codable) for Point, Rect, and Size:

extension Point: Sendable where Value: Sendable {}
extension Rect: Sendable where Value: Sendable {}
extension Size: Sendable where Value: Sendable {}

Documentation

No external documentation updates are necessary. Sendable conformance is standard Swift protocol adoption following existing conditional conformances in FirebladeMath.

Testing

Verified build and executed unit tests via swift test. All 258 test cases across 21 test suites passed without issues.

Performance

Zero runtime impact. Sendable conformance is evaluated at compile time by the Swift compiler.

Source Impact

Non-breaking additive change. Existing APIs are unchanged, and current user code remains fully compatible.

Checklist

  • I've read the Contribution Guidelines
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (to the extent possible).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexpected benchmark regressions.
  • I've updated the documentation (if appropriate).

@ctreffs
ctreffs force-pushed the sendable branch 2 times, most recently from 1fb6002 to b939d6f Compare August 9, 2026 06:15
@ctreffs
ctreffs merged commit 1c93d21 into master Aug 9, 2026
12 checks passed
@ctreffs
ctreffs deleted the sendable branch August 9, 2026 06:34
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