summary refs log tree commit diff stats
path: root/tests/template/mgensym_generic_cross_module.nim
blob: ea88f67e6ff1117b92b5138720db9d51c6dcd56a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
template makeDomElement(x: untyped, name: string = "") =
  const tag {.gensym.} = if name.len == 0: 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)