The following example doesn't generate any concurrency warnings in Swift 5.10:
@MainActor
public final class Test {
func process() {
}
}
public extension Test {
func start() {
let browser = NWBrowser(
for: .bonjour(type: MIDINetworkBonjourServiceType, domain: nil),
using: NWParameters()
)
browser.browseResultsChangedHandler = { [weak self] newResult, changes in
Task { [weak self] in
self?.process() // no warning, compiles ok
}
}
}
}
If I move start out of extension, then I get a warning as I would expect.
Is this a bug, or am I missing something here?