@@ -104,7 +104,7 @@ struct CheckString {
104
104
105
105
// Note any variables used by the pattern
106
106
for (varName, _) in self . pattern. variableUses {
107
- if varName. first == " @ " {
107
+ if varName. characters . first == " @ " {
108
108
// If we failed with a builtin variable like @LINE, try to report
109
109
// what it is bound to.
110
110
if let value = self . pattern. evaluateExpression ( varName) {
@@ -142,7 +142,7 @@ struct CheckString {
142
142
var BestLine : Int ? = nil
143
143
var BestQuality = 0.0
144
144
145
- for i in 0 ..< min ( buffer. count, 4096 ) {
145
+ for i in 0 ..< min ( buffer. characters . count, 4096 ) {
146
146
let exampleString : String
147
147
if pattern. fixedString. isEmpty {
148
148
exampleString = pattern. regExPattern
@@ -180,7 +180,7 @@ struct CheckString {
180
180
buffer. utf8CString. withUnsafeBufferPointer { buf in
181
181
let otherPatternLoc = CheckLoc . inBuffer (
182
182
buf. baseAddress!. advanced ( by: Best) ,
183
- UnsafeBufferPointer ( rebasing : buf. suffix ( from : Best) )
183
+ UnsafeBufferPointer ( start : buf. baseAddress ? . advanced ( by : Best) , count : buf . count - Best )
184
184
)
185
185
diagnose ( . note, at: otherPatternLoc, with: " possible intended match here " , options: options)
186
186
}
0 commit comments