Merge pull request #2856 from fowlmouth/patch-4

made string compatible with openarray[char]
This commit is contained in:
Andreas Rumpf
2015-06-15 21:04:50 +02:00
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
discard """
output: '''success'''
"""
var s = "HI"
proc x (zz: openarray[char]) =
discard
x s
proc z [T] (zz: openarray[T]) =
discard
z s
z([s,s,s])
proc y [T] (arg: var openarray[T]) =
arg[0] = 'X'
y s
doAssert s == "XI"
echo "success"