Skip to content

diagnose-api-breaking-changes treats nonisolated as an API breaking change #10055

@glbrntt

Description

@glbrntt

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

Adding the nonisolated keyword to a public struct in a module with default module isolation (i.e. non-isolated) is reported as an API breaking change by swift package diagnose-api-breaking-changes.

Under default module isolation, a plain struct is already nonisolated, so adding the keyword is a no-op and shouldn't be an issue.

Expected behavior

diagnose-api-breaking-changes shouldn't report issues.

Actual behavior

diagnose-api-breaking-changes reports that the API has been broken.

Steps to reproduce

nonisolated-struct-repro.zip

  1. Checkout attached Swift project
  2. Run swift package diagnose-api-breaking-changes baseline
3 breaking changes detected in Repro:
  💔 API breakage: struct S is now with nonisolated
  💔 API breakage: constructor S.init() is now with nonisolated
  💔 API breakage: func S.foo() is now with nonisolated

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions