From 774e66f3d123520c44016ca23fd103538fc3c87d Mon Sep 17 00:00:00 2001 From: flywind Date: Fri, 2 Apr 2021 17:56:30 +0800 Subject: [PATCH] close #7875 add testcase (#17611) * close #7875 add testcase * fix --- tests/macros/t7875.nim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/macros/t7875.nim diff --git a/tests/macros/t7875.nim b/tests/macros/t7875.nim new file mode 100644 index 0000000000..7b6e47b865 --- /dev/null +++ b/tests/macros/t7875.nim @@ -0,0 +1,22 @@ +discard """ + nimout: "var mysym`gensym0: MyType[float32]" + joinable: false +""" + +import macros + +type + MyType[T] = object + +# this is totally fine +var mysym: MyType[float32] + +macro foobar(): untyped = + let floatSym = bindSym"float32" + + result = quote do: + var mysym: MyType[`floatSym`] + + echo result.repr + +foobar()