src/niti: PrimitiveNativeFile use autoinit in named inits
authorJean Privat <jean@pryen.org>
Mon, 13 Jul 2015 16:42:31 +0000 (12:42 -0400)
committerJean Privat <jean@pryen.org>
Mon, 13 Jul 2015 16:44:36 +0000 (12:44 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/interpreter/primitive_types.nit

index 8f12c78..496840d 100644 (file)
@@ -23,23 +23,23 @@ class PrimitiveNativeFile
        var file: Stream
 
        init native_stdin do
-               file = sys.stdin
+               init(sys.stdin)
        end
 
        init native_stdout do
-               file = sys.stdout
+               init(sys.stdout)
        end
 
        init native_stderr do
-               file = sys.stderr
+               init(sys.stderr)
        end
 
        init io_open_read(path: String) do
-               file = new FileReader.open(path.to_s)
+               init(new FileReader.open(path.to_s))
        end
 
        init io_open_write(path: String) do
-               file = new FileWriter.open(path.to_s)
+               init(new FileWriter.open(path.to_s))
        end
 
        fun address_is_null: Bool do