@Task macro

I recently stumbled upon this macro which I did not notice in previous Swift versions: Task(name:priority:) | Apple Developer Documentation.

Since the documentation is quite scarce, I tried looking for the proposal that introduced this, but I couldn‘t find one. Would someone mind explaining what this does, or point me the a source with more explanation to how it works?

Thank you.

Edit: It seems to be an experimental feature, so I guess that is the reason there is not much material out, yet.

1 Like

Below is the implementation PR that provides more motivation.

4 Likes

Yeah, this has not gone through a evolution proposal so one should not assume this will stay in its current form, any removal/rename/change may still happen to this -- as indicated by the experimental status.

1 Like

For what it's worth we're removing that experimental macro :sweat_smile: Thanks for pointing out it was showing up looking as if it was not experiemntal in documentation, that's a another thing we need to look at in the future. Remove the experimental @Task macro by ktoso · Pull Request #82437 · swiftlang/swift · GitHub

5 Likes