Skip to content

Commit 9d1db4e

Browse files
committed
Remove TernaryExprSyntax Initializer
1 parent 334ecdc commit 9d1db4e

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

Sources/SwiftSyntaxBuilder/ConvenienceInitializers.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -321,24 +321,6 @@ extension StringLiteralExprSyntax {
321321
}
322322
}
323323

324-
// MARK: - TernaryExpr
325-
326-
extension TernaryExprSyntax {
327-
public init<C: ExprSyntaxProtocol, F: ExprSyntaxProtocol, S: ExprSyntaxProtocol>(
328-
if condition: C,
329-
then firstChoice: F,
330-
else secondChoice: S
331-
) {
332-
self.init(
333-
conditionExpression: condition,
334-
questionMark: .infixQuestionMarkToken(leadingTrivia: .space, trailingTrivia: .space),
335-
firstChoice: firstChoice,
336-
colonMark: .colonToken(leadingTrivia: .space),
337-
secondChoice: secondChoice
338-
)
339-
}
340-
}
341-
342324
// MARK: - TupleExprElement
343325

344326
extension TupleExprElementSyntax {

Tests/SwiftSyntaxBuilderTest/TernaryExprTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import SwiftSyntaxBuilder
1616

1717
final class TernaryExprTests: XCTestCase {
1818
func testTernaryExpr() {
19-
let buildable = TernaryExprSyntax(if: BooleanLiteralExprSyntax(true), then: ExprSyntax("a"), else: ExprSyntax("b"))
19+
let buildable = ExprSyntax("true ? a : b")
2020
AssertBuildResult(
2121
buildable,
2222
"""

0 commit comments

Comments
 (0)