Changes in new versions / Swift 6.0

// *** in version 6.0: ***
//in version 6 data races are caught
//by the compiler, not at runtime

final class Counter {
    var value = 0
}

let counter = Counter()

//Counter is not Sendable, so it cannot
//be handed to a task of its own
//Task.detached { counter.value += 1 }
//<- Error

//a Sendable value crosses freely
struct Point: Sendable {
    var x, y: Int
}

let point = Point(x: 3, y: 4)
await Task.detached {
    print("point is (\(point.x), \(point.y))")
}.value
//point is (3, 4)