This won't compile because BarFunc is not Sendable.
typealias BarFunc = (String) -> String
public struct Foo: Sendable {
let bar: BarFunc
}
Is it possible to mark BarFunc as sendable? Any other way to make this work?
This won't compile because BarFunc is not Sendable.
typealias BarFunc = (String) -> String
public struct Foo: Sendable {
let bar: BarFunc
}
Is it possible to mark BarFunc as sendable? Any other way to make this work?
This should do the trick:
typealias BarFunc = @Sendable (String) -> String
Thank you very much