nil in string concats does not produce crashes anymore
This commit is contained in:
parent
c8a412998a
commit
7c538b26ad
3 changed files with 42 additions and 12 deletions
25
tests/system/tnilconcats.nim
Normal file
25
tests/system/tnilconcats.nim
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue