Skip to content

Commit 5525fff

Browse files
authored
PackageDescription.Target.Dependency type have been changed to conform to Sendable (#8143)
PackageDescription.Target.Dependency type have been changed to conform to Sendable. ### Motivation: Since PackageDescription.Target.Dependency type does not conform to Sendable, we need to add `@preconcurrency` to ignore the warning from the dependency. The following is an example where `@preconcurrency` is required. ```swift // swift-tools-version: 6.0 @preconcurrency import PackageDescription // ... private extension PackageDescription.Target.Dependency { static let collections: Self = .product(name: "Collections", package: "swift-collections") static let asyncAlgorithms: Self = .product(name: "AsyncAlgorithms", package: "swift-async-algorithms") } ``` ### Modifications: PackageDescription.Target.Dependency type and TargetDependencyCondition type have been changed to conform to Sendable. ### Result: In the example above, `@preconcurrency` is not required.
1 parent b4486a8 commit 5525fff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/PackageDescription/Target.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final class Target {
4242
}
4343

4444
/// The different types of a target's dependency on another entity.
45-
public enum Dependency {
45+
public enum Dependency: Sendable {
4646
/// A dependency on a target.
4747
///
4848
/// - Parameters:
@@ -1357,7 +1357,7 @@ extension Target.Dependency {
13571357
}
13581358

13591359
/// A condition that limits the application of a target's dependency.
1360-
public struct TargetDependencyCondition {
1360+
public struct TargetDependencyCondition: Sendable {
13611361
let platforms: [Platform]?
13621362
let traits: Set<String>?
13631363

0 commit comments

Comments
 (0)