File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,10 @@ public struct DiagnosticsFormatter {
16
16
17
17
/// A wrapper struct for a source line and its diagnostics
18
18
private struct AnnotatedSourceLine {
19
- var diagnostics = [ Diagnostic] ( )
19
+ var diagnostics : [ Diagnostic ]
20
20
var sourceString : String
21
21
}
22
22
23
-
24
23
/// Number of lines which should be printed before and after the diagnostic message
25
24
static let contextSize = 2
26
25
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ public final class SourceLocationConverter {
147
147
return try source. withUnsafeBufferPointer { ( sourcePointer: UnsafeBufferPointer < UInt8 > ) in
148
148
var result : [ SyntaxText ] = [ ]
149
149
var previousLoc = AbsolutePosition . startOfFile
150
+ assert ( lines. first == AbsolutePosition . startOfFile)
150
151
for lineStartLoc in lines. dropFirst ( ) + [ endOfFile] {
151
152
result. append ( SyntaxText (
152
153
baseAddress: sourcePointer. baseAddress? . advanced ( by: previousLoc. utf8Offset) ,
You can’t perform that action at this time.
0 commit comments