Skip to content

Commit 534e5b6

Browse files
committed
Don’t add space after nonisolated in nonisolated(unsafe)
rdar://125801054
1 parent cfd0487 commit 534e5b6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-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(.nonisolated), .leftParen), // nonisolated(unsafe)
325326
(.keyword(.self), .period), // self.someProperty
326327
(.keyword(.self), .leftParen), // self()
327328
(.keyword(.self), .leftSquare), // self[]

Tests/SwiftBasicFormatTest/BasicFormatTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,4 +645,9 @@ final class BasicFormatTest: XCTestCase {
645645
"""
646646
assertFormatted(source: source, expected: source)
647647
}
648+
649+
func testNonisolatedUnsafeDoesNotAddSpace() throws {
650+
let source = "nonisolated(unsafe) var foo = 0"
651+
assertFormatted(source: source, expected: source)
652+
}
648653
}

0 commit comments

Comments
 (0)