fixes #2581
This commit is contained in:
parent
aacaa8f171
commit
54515241e3
2 changed files with 40 additions and 9 deletions
24
tests/js/tstringitems.nim
Normal file
24
tests/js/tstringitems.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
discard """
|
||||
output: '''Hello
|
||||
Hello'''
|
||||
"""
|
||||
|
||||
# bug #2581
|
||||
|
||||
const someVars = [ "Hello" ]
|
||||
var someVars2 = [ "Hello" ]
|
||||
|
||||
proc getSomeVar: string =
|
||||
for i in someVars:
|
||||
if i == "Hello":
|
||||
result = i
|
||||
break
|
||||
|
||||
proc getSomeVar2: string =
|
||||
for i in someVars2:
|
||||
if i == "Hello":
|
||||
result = i
|
||||
break
|
||||
|
||||
echo getSomeVar()
|
||||
echo getSomeVar2()
|
||||
Loading…
Add table
Add a link
Reference in a new issue