diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-04-29 20:56:30 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-04-29 20:56:30 +0200 |
commit | c870e831c8ab53adacffa80939be70de85de7601 (patch) | |
tree | d3d51b8af6fb2fce37b469681a1e91be6065c009 /tests | |
parent | b48e178969e7de319d0a96fcb4c60aeb0e057df5 (diff) | |
download | Nim-c870e831c8ab53adacffa80939be70de85de7601.tar.gz |
fixes #4124
Diffstat (limited to 'tests')
-rw-r--r-- | tests/types/typeof_produces_alias.nim | 25 |
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))) |