SwiftScanner icon indicating copy to clipboard operation
SwiftScanner copied to clipboard

Fatal error: String index is out of bounds

Open LyricApps opened this issue 6 years ago • 0 comments

Hi,

The following code crashes on the last line with a fatal error : String index is out of bounds instead of throwing an error

let scanner = StringScanner("1.0")
try scanner.skip(charactersIn: .whitespaces)
let red = try scanner.scanFloat()
try scanner.skip(charactersIn: .whitespaces)
let green = try scanner.scanFloat()

LyricApps avatar Mar 17 '19 10:03 LyricApps