Nim/tests/destructor/tv2_cast.nim
Clyybber 2f56dd6b2b Extend the fix for #11018 to strings (#11031)
* Extend the fix for #11018 to strings

* Fix testcase
2019-04-15 17:06:31 +02:00

19 lines
412 B
Nim

discard """
cmd: '''nim c --newruntime $file'''
output: '''@[1]
@[116, 101, 115, 116]
test
@[1953719668, 875770417]'''
"""
# bug #11018
discard cast[seq[uint8]](@[1])
discard cast[seq[uint8]]("test")
echo cast[seq[uint8]](@[1])
echo cast[seq[uint8]]("test")
discard cast[string](@[116'u8, 101, 115, 116])
echo cast[string](@[116'u8, 101, 115, 116])
var a = cast[seq[uint32]]("test1234")
a.setLen(2)
echo a