Skip to content

Backport BNNSScalar and MLShapedArrayScalar conformances of Float16 for older OS versions in Swift 6#405

Merged
ZachNagengast merged 1 commit intoargmaxinc:swift-6from
naykutguven:float16-fix-swift6
Jan 27, 2026
Merged

Backport BNNSScalar and MLShapedArrayScalar conformances of Float16 for older OS versions in Swift 6#405
ZachNagengast merged 1 commit intoargmaxinc:swift-6from
naykutguven:float16-fix-swift6

Conversation

@naykutguven
Copy link
Contributor

@naykutguven naykutguven commented Jan 22, 2026

This PR adds an availability-gated backport of Apple’s Float16 conformances for older OS versions, avoiding duplicate conformance on newer OS and compiling cleanly under Swift 6.

Platform-specific protocol conformance improvements:

  • Added @available(..., obsoleted: ...) annotations to the Float16 extensions for BNNSScalar and MLShapedArrayScalar on macOS and Mac Catalyst, ensuring these conformances are only available on supported OS versions and not visible on newer versions. The official conformances of Float16 implemented by Apple are available on macOS 26+ and macOS 15+, respectively.

Copilot AI review requested due to automatic review settings January 22, 2026 14:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the Float16 protocol conformances for BNNSScalar and MLShapedArrayScalar to be compatible with Swift 6 while preventing symbol conflicts with Apple's official implementations on newer OS versions.

Changes:

  • Added @retroactive annotations to Float16 extensions for Swift 6 compatibility
  • Implemented platform-specific availability with @available(obsoleted:) to prevent conflicts with Apple's conformances
  • Separated macOS and Mac Catalyst conformances with proper compiler directives
  • Added explicit implementations of required protocol properties (bnnsDataType and multiArrayDataType)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@naykutguven naykutguven changed the title Make BNNSScalar and MLShapedArrayScalar conformances of Float16 available in Swift 6 Backport BNNSScalar and MLShapedArrayScalar conformances of Float16 for older OS versions in Swift 6 Jan 22, 2026
@ZachNagengast ZachNagengast merged commit 65fa9ad into argmaxinc:swift-6 Jan 27, 2026
44 of 55 checks passed
@naykutguven naykutguven deleted the float16-fix-swift6 branch January 28, 2026 07:48
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