tv2_cast.nim 480 B

1234567891011121314151617181920212223
  1. discard """
  2. cmd: '''nim c --newruntime $file'''
  3. output: '''@[1]
  4. @[116, 101, 115, 116]
  5. @[1953719668, 875770417]'''
  6. """
  7. # bug #11018
  8. discard cast[seq[uint8]](@[1])
  9. discard cast[seq[uint8]]("test")
  10. echo cast[seq[uint8]](@[1])
  11. echo cast[seq[uint8]]("test")
  12. discard cast[string](@[116'u8, 101, 115, 116])
  13. #echo cast[string](@[116'u8, 101, 115, 116, 0])
  14. var a = cast[seq[uint32]]("test1234")
  15. a.setLen(2)
  16. echo a
  17. #issue 11204
  18. var ac {.compileTime.} = @["a", "b"]
  19. const bc = ac.len