tcast1.nim 329 B

12345678910111213141516171819202122
  1. discard """
  2. output: '''
  3. @[1.0, 2.0, 3.0]
  4. @[1.0, 2.0, 3.0]
  5. '''
  6. """
  7. # bug #6406
  8. import sequtils
  9. proc remap1(s: seq[int], T: typedesc): seq[T] =
  10. s.map do (x: int) -> T:
  11. x.T
  12. proc remap2[T](s: seq[int], typ: typedesc[T]): seq[T] =
  13. s.map do (x: int) -> T:
  14. x.T
  15. echo remap1(@[1,2,3], float)
  16. echo remap2(@[1,2,3], float)