From 22789a0bfc326ae6a292679b4e9d9eb2a295c26a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 23 Feb 2017 19:47:09 +0100 Subject: fixes #5419 --- tests/template/mgensym_generic_cross_module.nim | 14 ++++++++++++++ tests/template/tgensym_generic_cross_module.nim | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/template/mgensym_generic_cross_module.nim create mode 100644 tests/template/tgensym_generic_cross_module.nim (limited to 'tests') 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) diff --git a/tests/template/tgensym_generic_cross_module.nim b/tests/template/tgensym_generic_cross_module.nim new file mode 100644 index 000000000..856ab676d --- /dev/null +++ b/tests/template/tgensym_generic_cross_module.nim @@ -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 + -- cgit 1.4.1-2-gfad0 en2.nim?h=devel&id=c06f73b48456c194a2eb4692f0de63bea09449c4'>blame commit diff stats
path: root/compiler/docgen2.nim
blob: 118f1c7c537fb9ad862fe24a9afa3970937dd0d1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12