mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 05:53:39 +00:00
compiler,runtime: implement string to []rune conversion
Commit message by aykevl
This commit is contained in:
committed by
Ayke van Laethem
parent
fa5855bff5
commit
e9f6e51fc8
@@ -2458,8 +2458,10 @@ func (c *Compiler) parseConvert(typeFrom, typeTo types.Type, value llvm.Value, p
|
||||
switch elemType.Kind() {
|
||||
case types.Byte:
|
||||
return c.createRuntimeCall("stringToBytes", []llvm.Value{value}, ""), nil
|
||||
case types.Rune:
|
||||
return c.createRuntimeCall("stringToRunes", []llvm.Value{value}, ""), nil
|
||||
default:
|
||||
return llvm.Value{}, c.makeError(pos, "todo: convert from string: "+elemType.String())
|
||||
panic("unexpected type in string to slice conversion")
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user