fixes #4124
This commit is contained in:
parent
b48e178969
commit
c870e831c8
2 changed files with 33 additions and 3 deletions
25
tests/types/typeof_produces_alias.nim
Normal file
25
tests/types/typeof_produces_alias.nim
Normal file
|
|
@ -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)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue