@objc func foo() async?

I tried to make an @objc function async. Said function is registered via the NotificationCenter as an observer. While the compiler did not complain, I get a reproducible crash in objc_retain() when posting the notification.

Is that supposed to work? If not, would a compiler error not be a good thing then? Or should I open a bug report?

I would expect this to work, but I think we'll need more information about what specifically is going on. Filing a bug with a reproducible test case would help a lot here.

Doug

1 Like

Alright. Created a bug entry and a reproducible test case:

Swift Bug: [SR-15291] Concurrency: Crash when invoking async @objc function - Swift

Example Project: GitHub - mickeyl/swift-bugs: Example Projects for Swift Bug Tracker Issues – directory SR15291

Cheers, :m:

Terms of Service

Privacy Policy

Cookie Policy