summary refs log tree commit diff stats
path: root/tests/template/mgensym_generic_cross_module.nim
blob: 80b681db466443ef4f4fd63705f61a875a0455e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)