Skip to content

[6.3.2] Diagnose the use of a generic clause on @Test, @Suite, and @Tag.#1653

Merged
grynspan merged 1 commit into
release/6.3from
jgrynspan/diagnose-generic-clause-on-test-attribute-6.3
Apr 1, 2026
Merged

[6.3.2] Diagnose the use of a generic clause on @Test, @Suite, and @Tag.#1653
grynspan merged 1 commit into
release/6.3from
jgrynspan/diagnose-generic-clause-on-test-attribute-6.3

Conversation

@grynspan

@grynspan grynspan commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

#1650)

For example:

```swift
@test<[Int]>(arguments: [1, 2, 3]) func f(i: Int) { ... }
```

We never intended for this to be valid syntax. It appears some folks
_are_ using it, so deprecate for now and make it an error in the next
language mode. The diagnostic looks like this in the Swift 6 language
mode:

> ⚠️ Generic argument clause of attribute 'Test' is unsupported; this is
an error in the Swift 7 language mode

And in the Swift 7 language mode, it's an error. (In the future, if we
find that this syntax is useful and want to build out some sort of
support for it, we can of course remove the diagnostic.)

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
@grynspan grynspan added this to the Swift 6.3.x milestone Apr 1, 2026
@grynspan grynspan self-assigned this Apr 1, 2026
@grynspan grynspan added bug 🪲 Something isn't working macros 🔭 Related to Swift macros such as @Test or #expect labels Apr 1, 2026
@grynspan grynspan merged commit d0fd54f into release/6.3 Apr 1, 2026
29 checks passed
@grynspan grynspan deleted the jgrynspan/diagnose-generic-clause-on-test-attribute-6.3 branch April 1, 2026 19:04
@grynspan grynspan changed the title [6.3.x] Diagnose the use of a generic clause on @Test, @Suite, and @Tag. [6.3.2] Diagnose the use of a generic clause on @Test, @Suite, and @Tag. Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working macros 🔭 Related to Swift macros such as @Test or #expect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants