Skip to content

Commit bb6f796

Browse files
committed
Remove spacing between Any and .
1 parent 49b3bbd commit bb6f796

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Sources/SwiftBasicFormat/BasicFormat.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ open class BasicFormat: SyntaxRewriter {
206206
(.identifier, .leftSquare), // myArray[1]
207207
(.identifier, .period), // a.b
208208
(.integerLiteral, .period), // macOS 11.2.1
209+
(.keyword(.Any), .period), // Any.Type
209210
(.keyword(.`init`), .leftAngle), // init<T>()
210211
(.keyword(.`init`), .leftParen), // init()
211212
(.keyword(.self), .period), // self.someProperty

Tests/SwiftSyntaxBuilderTest/VariableTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,17 @@ final class VariableTests: XCTestCase {
371371
assertBuildResult(builder, expected, line: line)
372372
}
373373
}
374+
375+
// https://github.com/apple/swift-syntax/issues/1815
376+
func testSpacingInDictionaryType() throws {
377+
let buildable = try VariableDeclSyntax("static var mirror: Dictionary<String, Any.Type>") {}
378+
379+
assertBuildResult(
380+
buildable,
381+
"""
382+
static var mirror: Dictionary<String, Any.Type> {
383+
}
384+
"""
385+
)
386+
}
374387
}

0 commit comments

Comments
 (0)