This commit is contained in:
Andreas Rumpf 2016-08-02 14:53:21 +02:00
commit 4d5c0027e6
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,23 @@
discard """
output: '''test
test'''
"""
# bug #4537
# nim js --d:nodejs
type
Str = distinct string
when true:
# crashes
converter convert(s: string | cstring): Str = Str($s)
else:
# works!
converter convert(s: string): Str = Str($s)
converter convert(s: cstring): Str = Str($s)
proc echoStr(s: Str) = echo s.string
echoStr("test")
echoStr("test".cstring)