Skip to content

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Oct 8, 2025

This PR updates our parsing of the @available attribute during expansion of the @Test and @Suite macros to support custom availability domains of the form:

@available(Foo) @Test func f() {}

This change means the macro expansion will include if #available(Foo) instead of if #available(Foo, *) in this case.

Resolves rdar://160323829.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

This PR updates our parsing of the `@available` attribute during expansion of
the `@Test` and `@Suite` macros to support custom availability domains of the
form:

```swift
@available(Foo) @test func f() {}
```

This change means the macro expansion will include `if #available(Foo)` instead
of `if #available(Foo, *)` in this case.

Resolves rdar://160323829.
@grynspan grynspan added this to the Swift 6.x (main) milestone Oct 8, 2025
@grynspan grynspan requested a review from tshortli October 8, 2025 17:30
@grynspan grynspan self-assigned this Oct 8, 2025
@grynspan grynspan added enhancement New feature or request macros 🔭 Related to Swift macros such as @Test or #expect labels Oct 8, 2025
@grynspan grynspan requested a review from stmontgomery October 8, 2025 17:40
@grynspan
Copy link
Contributor Author

grynspan commented Oct 8, 2025

Ignoring failed Windows CI as it's a known issue with the toolchain.

@grynspan grynspan merged commit ffda98a into main Oct 8, 2025
45 of 48 checks passed
@grynspan grynspan deleted the jgrynspan/160323829-custom-availability-domains branch October 8, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request macros 🔭 Related to Swift macros such as @Test or #expect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants