Open tcldr opened 8 months ago
class Unit
and class Dimension
Sendable
. The Objective-C header that defines NSUnit
and NSDimension
isn't open source, so I'm going to throw the proposal here: I propose that we append __attribute__((swift_attr("@Sendable")))
to the class definition, so that subclasses can and must truthfully conform to @unchecked Sendable
.
I'm not sure of the best place to surface this, but as mentioned on this Swift forums post it seems to me that the explicit, unavailable Sendable conformance of
Unit
andDimension
, is incompatible with the stated usage ofUnit
andDimension
.Specifically, in strict concurrency 'complete' mode, the Swift 5.10 compiler flags the creation of static properties with the warning 'Static property 'x' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor'. Of course, Isolating properties to an Actor isn't feasible either as not only does being tied to an Actor limit the utility of the class, but the the properties become inaccessible to the essential
baseUnit
override.Perhaps this is something that https://github.com/apple/swift-foundation/issues/237 will address?