Your can store the variable locally before using it as a parameter:
@MainActor struct Foo {
var num: Int { 42 }
nonisolated func foo(_ int: Int) async {}
func bar() async {
var num = num // sometimes a let works too, but not always
await foo(num)
}
}
I also ran into this issue, but am unable to build my project with the Swift 6.0.1 toolchain, as Xcode reports an SDK/toolchain mismatch when trying to import SwiftUI.