Skip to content

Commit 2ca2dc2

Browse files
committed
Move SwitchCaseSyntax initializer
1 parent 08f027d commit 2ca2dc2

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Sources/SwiftSyntaxBuilder/ConvenienceInitializers.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,6 @@ extension StringLiteralExprSyntax {
358358
}
359359
}
360360

361-
// MARK: - SwitchCase
362-
363-
extension SwitchCaseSyntax {
364-
public init(_ label: SwitchCaseSyntax, @CodeBlockItemListBuilder statementsBuilder: () -> CodeBlockItemListSyntax) {
365-
self = label
366-
self.statements = statementsBuilder()
367-
}
368-
}
369-
370361
// MARK: - TernaryExpr
371362

372363
extension TernaryExprSyntax {

Sources/SwiftSyntaxBuilder/SyntaxNodeWithBody.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ public extension IfStmtSyntax {
144144
}
145145
}
146146

147+
// MARK: - SwitchCase
148+
149+
extension SwitchCaseSyntax {
150+
public init(_ header: PartialSyntaxNodeString, @CodeBlockItemListBuilder statementsBuilder: () -> CodeBlockItemListSyntax) {
151+
self = SwitchCaseSyntax("\(header)")
152+
self.statements = statementsBuilder()
153+
}
154+
}
155+
147156
// MARK: - SwitchStmtSyntax
148157
// SwitchStmtSyntax is a special scenario as it don't have body or members
149158
// So we cannot conform to `HasTrailingCodeBlock` or `HasTrailingMemberDeclBlock`

0 commit comments

Comments
 (0)