Thanks for reporting this issue - it is definitely a bug in the compiler. This code used to compile in Swift 5.5, but now does not because of Sendable checking. I have filed rdar://91780682 to track getting this regression fixed. Luckily you have identified some workarounds available to you.
2 Likes