summary refs log tree commit diff stats
path: root/tests/generics/tmapping_generic_alias.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generics/tmapping_generic_alias.nim')
-rw-r--r--tests/generics/tmapping_generic_alias.nim28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/generics/tmapping_generic_alias.nim b/tests/generics/tmapping_generic_alias.nim
new file mode 100644
index 000000000..efdf32ead
--- /dev/null
+++ b/tests/generics/tmapping_generic_alias.nim
@@ -0,0 +1,28 @@
+discard """
+output: '''type(c) = GenAlias[system.int]
+T = int
+seq[int]
+'''
+"""
+
+import typetraits
+
+type
+  Gen[T] = object
+    x: T
+
+  GenAlias[T] = Gen[seq[T]]
+
+proc f1[T](x: Gen[T]) =
+  echo T.name
+
+proc f2[T](x: GenAlias[T]) =
+  echo "type(c) = ", type(x).name
+  echo "T = ", T.name
+  f1 x
+
+let
+  y = Gen[seq[int]](x: @[10])
+
+f2 y
+