Skip to content

Commit 7a30825

Browse files
committed
Applied QA
1 parent 3baec45 commit 7a30825

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/SwiftDiagnostics/DiagnosticsFormatter.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ public struct DiagnosticsFormatter {
1616

1717
/// A wrapper struct for a source line and its diagnostics
1818
private struct AnnotatedSourceLine {
19-
var diagnostics = [Diagnostic]()
19+
var diagnostics: [Diagnostic]
2020
var sourceString: String
2121
}
2222

23-
2423
/// Number of lines which should be printed before and after the diagnostic message
2524
static let contextSize = 2
2625

Sources/SwiftSyntax/SourceLocation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public final class SourceLocationConverter {
147147
return try source.withUnsafeBufferPointer { (sourcePointer: UnsafeBufferPointer<UInt8>) in
148148
var result: [SyntaxText] = []
149149
var previousLoc = AbsolutePosition.startOfFile
150+
assert(lines.first == AbsolutePosition.startOfFile)
150151
for lineStartLoc in lines.dropFirst() + [endOfFile] {
151152
result.append(SyntaxText(
152153
baseAddress: sourcePointer.baseAddress?.advanced(by: previousLoc.utf8Offset),

0 commit comments

Comments
 (0)