Skip to content

Commit 0f3ee52

Browse files
committed
Don’t add a space between private and (
rdar://124569733
1 parent cfd0487 commit 0f3ee52

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Sources/SwiftBasicFormat/BasicFormat.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ open class BasicFormat: SyntaxRewriter {
322322
(.keyword(.Any), .period), // Any.Type
323323
(.keyword(.`init`), .leftAngle), // init<T>()
324324
(.keyword(.`init`), .leftParen), // init()
325+
(.keyword(.private), .leftParen), // private(set)
325326
(.keyword(.self), .period), // self.someProperty
326327
(.keyword(.self), .leftParen), // self()
327328
(.keyword(.self), .leftSquare), // self[]

Tests/SwiftBasicFormatTest/BasicFormatTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,4 +645,12 @@ final class BasicFormatTest: XCTestCase {
645645
"""
646646
assertFormatted(source: source, expected: source)
647647
}
648+
649+
func testPrivateSetVar() {
650+
let source = """
651+
private(set) var x = 1
652+
"""
653+
654+
assertFormatted(source: source, expected: source)
655+
}
648656
}

0 commit comments

Comments
 (0)