diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/macros/t9194.nim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/macros/t9194.nim b/tests/macros/t9194.nim new file mode 100644 index 000000000..ef58750aa --- /dev/null +++ b/tests/macros/t9194.nim @@ -0,0 +1,20 @@ +discard """ + output: ''' +range[0 .. 100] +array[0 .. 100, int] +''' +""" + +import macros + +type + Foo1 = range[0 .. 100] + Foo2 = array[0 .. 100, int] + +macro get(T: typedesc): untyped = + # Get the X out of typedesc[X] + let tmp = getTypeImpl(T) + result = newStrLitNode(getTypeImpl(tmp[1]).repr) + +echo Foo1.get +echo Foo2.get |