Skip to content

Commit d569e5f

Browse files
committed
Concurrency safety fixes
1 parent 0419223 commit d569e5f

4 files changed

Lines changed: 12 additions & 17 deletions

File tree

Package.resolved

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
],
1515
dependencies: [
1616
// Dependencies declare other packages that this package depends on.
17-
.package(url: "https://github.com/toastersocks/SwiftCheck", .upToNextMajor(from: "0.13.0")),
17+
.package(url: "https://github.com/toastersocks/SwiftCheck", .upToNextMajor(from: "0.13.1")),
1818
],
1919
targets: [
2020
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

Sources/Flow/Flow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import SwiftUI
22

33

44
/// A Flow layout arranges its subviews in a line, wrapping at the edge and starting new lines as needed, similar to how words wrap in a paragraph.
5-
public struct Flow: Layout {
5+
public struct Flow: Layout, Sendable {
66
/// The alignment of the subviews within the container.
77
let alignment: Alignment
88
/// The space between subviews.
@@ -210,7 +210,7 @@ public struct Flow: Layout {
210210
}
211211

212212
/// The alignment of subviews within the flow.
213-
public enum Alignment: CaseIterable {
213+
public enum Alignment: CaseIterable, Sendable {
214214
/// Aligns the tops of subviews within a row. Rows are flush with the leading edge of the container.
215215
case topLeading
216216
/// Aligns the tops of subviews within a row. Rows are flush with the trailing edge of the container.

Tests/FlowTests/+Arbitrary.swift

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,8 @@ extension CGFloat: @retroactive Arbitrary {
2626
}
2727
}
2828
}
29-
30-
extension Flow.Alignment: @retroactive Arbitrary {
31-
public static var arbitrary: Gen<Flow.Alignment> {
32-
Gen<Flow.Alignment>.fromElements(of: [.topLeading, .topTrailing, .bottomLeading, .bottomTrailing, .center, .centerJustify, .centerDistribute])
33-
}
34-
}
3529
#else
36-
extension CGSize: @retroactive Arbitrary {
30+
extension CGSize: Arbitrary {
3731
public static var arbitrary: Gen<CGSize> {
3832
Gen<CGSize>.compose { composer in
3933
CGSize(width: composer.generate(using: Double.arbitrary.suchThat { $0 >= 0 && $0 <= 410 }),
@@ -42,20 +36,20 @@ extension CGSize: @retroactive Arbitrary {
4236
}
4337
}
4438

45-
extension CGFloat: @retroactive Arbitrary {
39+
extension CGFloat: Arbitrary {
4640
public static var arbitrary: Gen<CGFloat> {
4741
Gen<CGFloat>.compose { composer in
4842
CGFloat(Double.arbitrary.generate)
4943
}
5044
}
45+
}
46+
#endif
5147

52-
53-
extension Flow.Alignment: @retroactive Arbitrary {
48+
extension Flow.Alignment: Arbitrary {
5449
public static var arbitrary: Gen<Flow.Alignment> {
5550
Gen<Flow.Alignment>.fromElements(of: [.topLeading, .topTrailing, .bottomLeading, .bottomTrailing, .center, .centerJustify, .centerDistribute])
5651
}
5752
}
58-
#endif
5953

6054
extension MockLayoutSubview: Arbitrary {
6155
public static var arbitrary: Gen<MockLayoutSubview> {

0 commit comments

Comments
 (0)