summary refs log tree commit diff stats
path: root/tests/generics/t18859.nim
diff options
context:
space:
mode:
authoralaviss <leorize+oss@disroot.org>2021-09-17 04:51:26 +0000
committerGitHub <noreply@github.com>2021-09-17 06:51:26 +0200
commit6cd219c3a38c5f1a0712b0b5d07a3ea4ab02ff74 (patch)
tree89dada4d28a47b0853d758836e68812abdd43546 /tests/generics/t18859.nim
parentf8e185fec0d8f9caddc196a713fba196b14f8b6b (diff)
downloadNim-6cd219c3a38c5f1a0712b0b5d07a3ea4ab02ff74.tar.gz
semtypinst: don't wrap type nodes from expressions in static[T] (#18860)
Diffstat (limited to 'tests/generics/t18859.nim')
-rw-r--r--tests/generics/t18859.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/generics/t18859.nim b/tests/generics/t18859.nim
new file mode 100644
index 000000000..ca6c3d10b
--- /dev/null
+++ b/tests/generics/t18859.nim
@@ -0,0 +1,17 @@
+import macros
+
+macro symFromDesc(T: typedesc): untyped =
+  let typ = getType(T)
+  typ[1]
+
+template produceType(T: typedesc): untyped =
+  type
+    XT = object
+      x: symFromDesc(T)
+
+  XT
+
+type
+  X[T] = produceType(T)
+
+var x: X[int]