Cannot find 'weak' in scope on closure of a DispatchQue.async

let concurrentQueue = DispatchQueue(label: "concurrentQueue",
qos: .background, attributes: .concurrent)
concurrentQueue.async { [weak self] // Cannot find 'weak' in scope
guard let self = self else { return }
}

I verified the API is @escaping as one would suspect.

I'm sure I am missing some core concept, but my searches keep leading to no answers.

You’re missing in after [weak self].

1 Like

Oh wow. time to step away from the code for a few hours!
Thank you!

Is there a forum to suggest xcode error fix hints?

What you want is a diagnostic fix-it, which is actually done in the language. It would be best if made an issue on the GitHub repo.

To give a bit more on the syntax, what you are referring to are capture lists. Annoyingly to me, it isn't defined in the documentation for syntax structure but only in the documentation for ARC.

1 Like

I’ll take a look and put that in.
Thank you.