I tried a bunch of things but wasn’t able to reproduce this. Here’s an example of what I did: import Foundation import Photos @MainActor func show(imageInfo: (path: String, asset: PHAsset?)) { } class Test { func onCaptureCompleted(_ imageURL: URL, asset: PHAsset?) { let path = imageURL.path() Task { @MainActor in show(imageInfo: (path, asset)) } } } func main() { print(Hello Cruel World!) } main() This compiles just fine with Xcode 16.2 in Swift 6 language mode. Which version of Xcode are you using? Can you post a snippet that shows the problem? Please post it as text rather than an image. See tips 5 and 6 in Quinn’s Top Ten DevForums Tips. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic:
Programming Languages
SubTopic:
Swift
Tags: