diff options
Diffstat (limited to 'tests/template/t21532.nim')
-rw-r--r-- | tests/template/t21532.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/template/t21532.nim b/tests/template/t21532.nim new file mode 100644 index 000000000..3193b0dc3 --- /dev/null +++ b/tests/template/t21532.nim @@ -0,0 +1,8 @@ + +template elementType(a: untyped): typedesc = + typeof(block: (for ai in a: ai)) + +func fn[T](a: T) = + doAssert elementType(a) is int + +@[1,2,3].fn \ No newline at end of file |