autoclose streams, fix #9

This commit is contained in:
mratsim 2019-09-10 20:26:25 -04:00
parent e874ae6766
commit cb6055a8be
1 changed files with 1 additions and 0 deletions

View File

@ -89,6 +89,7 @@ template loadFile*(Format: distinct type,
params: varargs[untyped]): auto = params: varargs[untyped]): auto =
mixin init, ReaderType mixin init, ReaderType
var stream = openFile(filename) var stream = openFile(filename)
defer: stream.close() # TODO: destructors
# TODO: # TODO:
# Remove this when statement once the following bug is fixed: # Remove this when statement once the following bug is fixed: