onevcat / Rainbow

Delightful console output for Swift developers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optional Errors

anthonycastelli opened this issue · comments

These two lines return an optional value now, and are throwing the error Value of optional type 'String?' not unwrapped; did you mean to use '!' or '?'?

I'm not sure what the best way to handle this would be for this project, but in the return line, maybe doing something like return (codes, text ?? "")

let text = String(string[startIndex ..< endIndex])

let text = String(string[startIndex ..< endIndex])

The overload set for that initializer should not be different between the package build and the Xcode build. Subscript should be giving us a Substring which is trivially convertible to a String without needing optionality - which is what Xcode sees.

@anthonycastelli @CodaFi Thanks for reporting this. I will update the Package.swift soon to solve it.