I am trying to write a couple of functions to convert a Stringto an array of bytes [UInt8]and vice versa.
As part of the function coming from [UInt8] -> String, I'm trying to convert one Int32to Character.
let num : Int32 = 5
let char = Character(_builtinUnicodeScalarLiteral: num)
But I get this strange error:
error: cannot convert value of type 'Int32' to expected argument type 'Int32'
let char = Character(_builtinUnicodeScalarLiteral: num)
^~~
EDIT: I was able to write my functions using different code, but I'm still curious about the meaning of the error.
source
share