add tests for recently closed issues (#10722)

This commit is contained in:
Miran 2019-02-23 10:41:35 +01:00 • committed by Andreas Rumpf
commit e7878c0d08
9 changed files with 177 additions and 1 deletions

21
tests/types/tcast1.nim Normal file
View file

@ -0,0 +1,21 @@
discard """
output: '''
@[1.0, 2.0, 3.0]
@[1.0, 2.0, 3.0]
'''
"""
# bug #6406
import sequtils
proc remap1(s: seq[int], T: typedesc): seq[T] =
s.map do (x: int) -> T:
x.T
proc remap2[T](s: seq[int], typ: typedesc[T]): seq[T] =
s.map do (x: int) -> T:
x.T
echo remap1(@[1,2,3], float)
echo remap2(@[1,2,3], float)