mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 23:35:22 +00:00
allow deferred close of nil stream (#20706)
* allow deferred close of nil stream * improve example
This commit is contained in:
@@ -50,6 +50,12 @@ block tstreams3:
|
||||
echo line
|
||||
s.close
|
||||
|
||||
|
||||
block:
|
||||
let fs = newFileStream("amissingfile.txt")
|
||||
defer: fs.close()
|
||||
doAssert isNil(fs)
|
||||
|
||||
# bug #12410
|
||||
|
||||
var a = newStringStream "hehohihahuhyh"
|
||||
|
||||
Reference in New Issue
Block a user