If a function annotated with @Reasync contains a nested type declaration, the generated peer overload will not compile, since the linker attempts to reference the type declaration in the original async function.
This is a compiler issue that affects all peer, member, preamble, and body macros.
Upstream issue: swiftlang/swift#88174
Pending fix: swiftlang/swift#88898
Workaround
Declare nested types outside functions annotated with a peer, member, preamble, or body macro.
Reproduction
@Reasync
func example() async
{
struct Local
{
let x: Int
}
_ = Local(x: 1)
}
If a function annotated with
@Reasynccontains a nested type declaration, the generated peer overload will not compile, since the linker attempts to reference the type declaration in the originalasyncfunction.This is a compiler issue that affects all peer, member, preamble, and body macros.
Upstream issue: swiftlang/swift#88174
Pending fix: swiftlang/swift#88898
Workaround
Declare nested types outside functions annotated with a peer, member, preamble, or body macro.
Reproduction