mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
compiler,runtime: implement []rune to string conversion
This is used by a few packages in the standard library, at least compress/gzip and regexp/syntax.
This commit is contained in:
committed by
Ron Evans
parent
fea56d4164
commit
fd3309afa8
@@ -2415,6 +2415,8 @@ func (c *Compiler) parseConvert(typeFrom, typeTo types.Type, value llvm.Value, p
|
||||
switch typeFrom.Elem().(*types.Basic).Kind() {
|
||||
case types.Byte:
|
||||
return c.createRuntimeCall("stringFromBytes", []llvm.Value{value}, ""), nil
|
||||
case types.Rune:
|
||||
return c.createRuntimeCall("stringFromRunes", []llvm.Value{value}, ""), nil
|
||||
default:
|
||||
return llvm.Value{}, c.makeError(pos, "todo: convert to string: "+typeFrom.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user