summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-04-29 20:56:30 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-04-29 20:56:30 +0200
commitc870e831c8ab53adacffa80939be70de85de7601 (patch)
treed3d51b8af6fb2fce37b469681a1e91be6065c009 /tests
parentb48e178969e7de319d0a96fcb4c60aeb0e057df5 (diff)
downloadNim-c870e831c8ab53adacffa80939be70de85de7601.tar.gz
fixes #4124
Diffstat (limited to 'tests')
-rw-r--r--tests/types/typeof_produces_alias.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/types/typeof_produces_alias.nim b/tests/types/typeof_produces_alias.nim
new file mode 100644
index 000000000..44cb00c94
--- /dev/null
+++ b/tests/types/typeof_produces_alias.nim
@@ -0,0 +1,25 @@
+
+# bug #4124
+
+import sequtils
+
+type
+    Foo = distinct string
+
+var
+  foo: Foo
+
+type
+    Alias = (type(foo))
+var
+  a: Alias
+
+a = foo
+
+when true:
+  var xs = @[1,2,3]
+
+  proc asFoo(i: string): Foo =
+      Foo(i)
+
+  var xx = xs.mapIt(asFoo($(it + 5)))