fixes #5419
This commit is contained in:
parent
92c2a51bf7
commit
22789a0bfc
4 changed files with 35 additions and 1 deletions
14
tests/template/mgensym_generic_cross_module.nim
Normal file
14
tests/template/mgensym_generic_cross_module.nim
Normal file
|
|
@ -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)
|
||||
14
tests/template/tgensym_generic_cross_module.nim
Normal file
14
tests/template/tgensym_generic_cross_module.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
discard """
|
||||
output: '''foo55
|
||||
foo8.0
|
||||
fooaha
|
||||
bar7'''
|
||||
"""
|
||||
# bug #5419
|
||||
import mgensym_generic_cross_module
|
||||
|
||||
foo(55)
|
||||
foo 8.0
|
||||
foo "aha"
|
||||
bar 7
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue