@@ -104,7 +104,7 @@ struct CheckString {
104104
105105 // Note any variables used by the pattern
106106 for (varName, _) in self . pattern. variableUses {
107- if varName. first == " @ " {
107+ if varName. characters . first == " @ " {
108108 // If we failed with a builtin variable like @LINE, try to report
109109 // what it is bound to.
110110 if let value = self . pattern. evaluateExpression ( varName) {
@@ -142,7 +142,7 @@ struct CheckString {
142142 var BestLine : Int ? = nil
143143 var BestQuality = 0.0
144144
145- for i in 0 ..< min ( buffer. count, 4096 ) {
145+ for i in 0 ..< min ( buffer. characters . count, 4096 ) {
146146 let exampleString : String
147147 if pattern. fixedString. isEmpty {
148148 exampleString = pattern. regExPattern
@@ -180,7 +180,7 @@ struct CheckString {
180180 buffer. utf8CString. withUnsafeBufferPointer { buf in
181181 let otherPatternLoc = CheckLoc . inBuffer (
182182 buf. baseAddress!. advanced ( by: Best) ,
183- UnsafeBufferPointer ( rebasing : buf. suffix ( from : Best) )
183+ UnsafeBufferPointer ( start : buf. baseAddress ? . advanced ( by : Best) , count : buf . count - Best )
184184 )
185185 diagnose ( . note, at: otherPatternLoc, with: " possible intended match here " , options: options)
186186 }
0 commit comments