Undefined Symbol Error when using async/await function in module

I applied modularization on my project.
I also created the Someclass and the async function in the module.
Finally, I made the class which inheritances the SomeClass in Main Project

Below is the code.

Module


//

// SomeClass.swift

// SubModule

import Foundation

open class SomeClass {

func requestNetwork() async { }

}

MainProject


//

// NewSomeClass.swift

// MainProject

import SubModule

class NewSomeClass: SomeClass { }

I have already success to build through the debug build configuration.

However, I failed to build it using the release build configuration.

What is the problem with my second attempt?
Please give me a comment.

If you want to try build, here's the source code. (Github)

2 Likes

Sorry for reviving this thread, but I figured I could help save some times to others in the same situation as the original poster and myself (today).

I found this same issue, and found that the reason this is triggered in release builds is because it's an issue with the optimizations, specifically with inline optimizations.

You can resolve the error by marking method requestNetwork as @inline(never).