added a test
This commit is contained in:
parent
87c8d586b5
commit
80a13a408e
1 changed files with 22 additions and 0 deletions
22
tests/typerel/tstr_as_openarray.nim
Normal file
22
tests/typerel/tstr_as_openarray.nim
Normal 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"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue