mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-03 04:24:45 +00:00
Fix defer not not-working at top level (#10191)
This commit is contained in:
committed by
Andreas Rumpf
parent
15773c455a
commit
e77dd683eb
@@ -9,7 +9,6 @@ import os, asyncfile, asyncdispatch
|
||||
const F = "test_async.txt"
|
||||
|
||||
removeFile(F)
|
||||
defer: removeFile(F)
|
||||
let f = openAsync(F, fmWrite)
|
||||
var futs = newSeq[Future[void]]()
|
||||
for i in 1..3:
|
||||
@@ -17,4 +16,4 @@ for i in 1..3:
|
||||
waitFor(all(futs))
|
||||
f.close()
|
||||
echo readFile(F)
|
||||
|
||||
removeFile(F)
|
||||
|
||||
Reference in New Issue
Block a user