Probably another inconsistency, but the following code creating an actor backed by serial DispatchQueue works on macOS and does not compile under Linux:
public actor MyActor {
let queue = DispatchSerialQueue(label: "actorQueue")
nonisolated public var unownedExecutor: UnownedSerialExecutor {
queue.asUnownedSerialExecutor()
}
}
Under Linux it produces the following error:
/src/Sources/Test/test.swift:63:17: error: cannot find 'DispatchSerialQueue' in scope
61 | public actor MyActor {
62 | let logger: Logger
63 | let queue = DispatchSerialQueue(label: "relayQueue")
| `- error: cannot find 'DispatchSerialQueue' in scope
64 |
65 | nonisolated public var unownedExecutor: UnownedSerialExecutor {
Probably another inconsistency, but the following code creating an
actorbacked by serialDispatchQueueworks on macOS and does not compile under Linux:Under Linux it produces the following error: