diff options
Diffstat (limited to 'tests/template/mgensym_generic_cross_module.nim')
-rw-r--r-- | tests/template/mgensym_generic_cross_module.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/template/mgensym_generic_cross_module.nim b/tests/template/mgensym_generic_cross_module.nim new file mode 100644 index 000000000..80b681db4 --- /dev/null +++ b/tests/template/mgensym_generic_cross_module.nim @@ -0,0 +1,14 @@ + +template makeDomElement(x: untyped, name: string = nil) = + const tag {.gensym.} = if name == nil: astToStr(x) else: name + + proc x*(p: int|float) = + echo tag, p + + proc x*(p: string|cstring) = + echo tag, p + +#proc wrappedUp[T](x: T) = +# mixin foo, bar +makeDomElement(foo, "foo") +makeDomElement(bar) |