Linking issue when subclassing and using Task

When compiling in Debug configuration, everything is fine, when compiling in Release configuration, it will fail. .. how to reproduce that ?

The Swift scenario is the following :

  • given a class ‘open’ in a static library (SPM)
  • if that class has an ‘open’ method performing an asynchronous Task, which itself calls an internal (or private) method
  • when subclassing that class outside the package
  • Xcode Archive / or Release configuration can’t make it through linking

I created a sample repo here GitHub - quentinfasquel/swift-task-linking-issue as well as submitted to Apple's Feedback Assistant.

It turns out people probably don't do much subclassing in Swift nowadays because nobody seems to face that bug. But this is still a bug in my opinion.