mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
(cherry picked from commit 2d9af2bd55)
This commit is contained in:
@@ -3,7 +3,7 @@ discard """
|
||||
x + y = 30
|
||||
'''
|
||||
"""
|
||||
import std/[sugar, algorithm, random, sets, tables, strutils]
|
||||
import std/[sugar, algorithm, random, sets, tables, strutils, sequtils]
|
||||
|
||||
template main() =
|
||||
block: # `=>`
|
||||
@@ -226,6 +226,17 @@ proc mainProc() =
|
||||
doAssertRaises(AssertionDefect): doAssert false
|
||||
doAssert "except AssertionDefect" in s2
|
||||
|
||||
block: # bug #20704
|
||||
proc test() =
|
||||
var xs, ys: seq[int]
|
||||
for i in 0..5:
|
||||
xs.add(i)
|
||||
|
||||
xs.apply(d => ys.add(d))
|
||||
doAssert ys == @[0, 1, 2, 3, 4, 5]
|
||||
|
||||
test()
|
||||
|
||||
static:
|
||||
main()
|
||||
mainProc()
|
||||
|
||||
Reference in New Issue
Block a user