Skip to content

Swift 5.10+ warning: Date: Strideable conformance needs @retroactive #59

@nicwaller

Description

@nicwaller

I'm sharing this issue & resolution to help other people who run into the same problem that I did.

Problem

Building a project that depends on SunKit 2.8.1 with Swift 5.10+ produces this warning:

extension declares a conformance of imported type 'Date' to imported protocol 'Strideable';
this will not behave correctly if the owners of 'Foundation' introduce this conformance in the future

This comes from Sources/SunKit/Extensions.swift:22:

extension Date: Strideable {

Explanation

The fix (@retroactive) was already applied in f883b1f which is in the main branch. However, the most recent release tag 2.8.1 lags behind the main branch and there are currently no subsequent releases that include the fix.

Workaround

I modified my Package.swift and Package.resolved files to pin the specific known-good version:

.package(url: "https://github.com/SunKit-Swift/SunKit", revision: "a18a6f7")

Request

Could you cut a new release (e.g. 2.8.2) that includes the @retroactive fix? This would be helpful to new users of the package that are likely to use the latest release tag by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions