Is @CaseDetection macro included in Swift 5.9 Xcode 15?

Hey all,

I noticed a useful macro in the "What's new in Swift" WWDC2023 session called @CaseDetection. Seems like they used it in the presentation without defining it, so I assumed it was included in the Swift 5.9 installation?

@CaseDetection is not a recognized attribute in my XCode 15 beta. Is that expected?

Best, T

  • Additionally, I'd love to know if Apple has a list of the new macros included with Swift by default. The Swift documentation appears to be more about how they work and how to write our own.

Add a Comment

Replies

  • Doesn't look like that link/page exists ... did anybody ever find the macro?

Add a Comment

@CaseDetection is part of the Swift-Syntax package, in the examples section: https://github.com/apple/swift-syntax/tree/main/Examples

  • Thanks for your reply! The link works, but does anyone know why they've chosen to have this separate from their official Swift documentation? I thought every method/library/framework that's available "out of the box" in Swift would have its own page in the official docs.

Add a Comment