Skip to content

Commit 644f61a

Browse files
committed
Remove SyntaxKind conformance to CaseIterable
There’s no good reason to iterate over all cases in `SyntaxKind` and if `SyntaxKind` conforms to `CaseIterable`, we can’t mark members of it as deprecated (https://github.com/apple/swift-syntax/pull/2237/files#r1359917461)
1 parent ccab07f commit 644f61a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxKindFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let syntaxKindFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
1919
try! EnumDeclSyntax(
2020
"""
2121
/// Enumerates the known kinds of Syntax represented in the Syntax tree.
22-
public enum SyntaxKind: CaseIterable
22+
public enum SyntaxKind
2323
"""
2424
) {
2525
DeclSyntax("case token")

Release Notes/511.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
- Effect specifiers:
1717
- Description: The `unexpectedAfterThrowsSpecifier` node of the various effect specifiers has been removed.
1818
- Pull request: https://github.com/apple/swift-syntax/pull/2219
19+
- `SyntaxKind` removed conformance to `CaseIterable`
20+
- Description: `SyntaxKind` no longer conforms to `CaseIterable` since there is no good use case to iterate over all syntax kinds.
21+
- Pull request:
1922

2023

2124
## Template

Sources/SwiftSyntax/generated/SyntaxKind.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
/// Enumerates the known kinds of Syntax represented in the Syntax tree.
16-
public enum SyntaxKind: CaseIterable {
16+
public enum SyntaxKind {
1717
case token
1818
case accessorBlock
1919
case accessorDeclList

0 commit comments

Comments
 (0)