nil in string concats does not produce crashes anymore

This commit is contained in:
Andreas Rumpf 2018-04-27 21:32:58 +02:00
commit 7c538b26ad
3 changed files with 42 additions and 12 deletions

View file

@ -0,0 +1,25 @@
discard """
output: '''@[nil, nil, nil, nil, nil, nil, nil, "meh"]'''
exitcode: "0"
"""
when true:
var ab: string
ab &= "more"
doAssert ab == "more"
var x: seq[string]
setLen(x, 7)
x.add "meh"
var s: string
var z = "abc"
var zz: string
s &= "foo" & z & zz
doAssert s == "fooabc"
echo x