Skip to content

Commit 5fea6d1

Browse files
committed
Don’t add space after nonisolated in nonisolated(unsafe)
rdar://125801054
1 parent 1672a3e commit 5fea6d1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-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(.private), .leftParen), // private(set)
326327
(.keyword(.self), .period), // self.someProperty
327328
(.keyword(.self), .leftParen), // self()

Tests/SwiftBasicFormatTest/BasicFormatTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,11 @@ final class BasicFormatTest: XCTestCase {
650650
let source = """
651651
private(set) var x = 1
652652
"""
653+
assertFormatted(source: source, expected: source)
654+
}
653655

656+
func testNonisolatedUnsafeDoesNotAddSpace() throws {
657+
let source = "nonisolated(unsafe) var foo = 0"
654658
assertFormatted(source: source, expected: source)
655659
}
656660
}

0 commit comments

Comments
 (0)