Skip to content

Add retroactive to Equatable conformance to fix compiler warnings#883

Open
sbooth wants to merge 2 commits intomainfrom
retroactive
Open

Add retroactive to Equatable conformance to fix compiler warnings#883
sbooth wants to merge 2 commits intomainfrom
retroactive

Conversation

@sbooth
Copy link
Owner

@sbooth sbooth commented Feb 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 26, 2026 23:27
Copy link
Contributor

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 adds the @retroactive attribute to Equatable protocol conformances for PlaybackTime and PlaybackPosition types to suppress Swift 6 compiler warnings about retroactive conformances. These types are C structs imported from the CSFBAudioEngine module that are being extended with protocol conformances in the Swift wrapper layer.

Changes:

  • Added @retroactive to Equatable conformance for PlaybackTime
  • Added @retroactive to Equatable conformance for PlaybackPosition

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Sources/SFBAudioEngine/SFBPlaybackTime.swift Adds @retroactive attribute to Equatable conformance for the imported PlaybackTime struct
Sources/SFBAudioEngine/SFBPlaybackPosition.swift Adds @retroactive attribute to Equatable conformance for the imported PlaybackPosition struct

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

}

extension PlaybackTime: Equatable {
extension PlaybackTime: @retroactive Equatable {
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The @retroactive attribute requires Swift 6.0 or later (introduced in SE-0364), but Package.swift declares swift-tools-version: 5.6. This will cause compilation errors for users building with Swift 5.x. Consider either:

  1. Updating Package.swift to require Swift 6.0 (changing swift-tools-version: 5.6 to swift-tools-version: 6.0)
  2. Adding a compiler version check to conditionally apply the attribute:
#if swift(>=6.0)
extension PlaybackTime: @retroactive Equatable {
#else
extension PlaybackTime: Equatable {
#endif

Note that option 1 would be a breaking change for users on older Swift versions, while option 2 maintains backward compatibility but allows warnings on Swift 5.x.

Copilot uses AI. Check for mistakes.
}

extension PlaybackPosition: Equatable {
extension PlaybackPosition: @retroactive Equatable {
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The @retroactive attribute requires Swift 6.0 or later (introduced in SE-0364), but Package.swift declares swift-tools-version: 5.6. This will cause compilation errors for users building with Swift 5.x. Consider either:

  1. Updating Package.swift to require Swift 6.0 (changing swift-tools-version: 5.6 to swift-tools-version: 6.0)
  2. Adding a compiler version check to conditionally apply the attribute:
#if swift(>=6.0)
extension PlaybackPosition: @retroactive Equatable {
#else
extension PlaybackPosition: Equatable {
#endif

Note that option 1 would be a breaking change for users on older Swift versions, while option 2 maintains backward compatibility but allows warnings on Swift 5.x.

Copilot uses AI. Check for mistakes.
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