@@ -74,8 +74,8 @@ function io.lines(filename, ...) end
7474--- some systems to open the file in binary mode.
7575--- @param filename string
7676--- @param mode ? iolib.OpenMode
77- --- @return file ?
78- --- @return string ? err
77+ --- @return _overload file
78+ --- @return _overload nil , string err
7979function io .open (filename , mode ) end
8080
8181---
@@ -132,8 +132,8 @@ function io.type(obj) end
132132---
133133--- Equivalent to `io.output():write(···)`.
134134--- @param ... string | number
135- --- @return file ?
136- --- @return string ? err
135+ --- @return _overload file
136+ --- @return _overload nil , string err
137137function io .write (...) end
138138
139139--- File object
@@ -148,24 +148,23 @@ local file = {}
148148---
149149--- When closing a file handle created with `io.popen`, `file:close` returns the
150150--- same values returned by `os.execute`.
151- --- @return true | nil
152- --- @return ' exit' | ' signal'
153- --- @return integer
151+ --- @return _overload true , ' exit' | ' signal' , integer
152+ --- @return _overload nil , ' exit' | ' signal' , integer
154153function file :close () end
155154
156155--- @version 5.1 , JIT
157156---
158157--- Closes `file`. Note that files are automatically closed when their
159158--- handles are garbage collected, but that takes an unpredictable amount of
160159--- time to happen.
161- --- @return true | nil
162- --- @return string ? err
160+ --- @return _overload true
161+ --- @return _overload nil , string err
163162function file :close () end
164163
165164---
166165--- Saves any written data to `file`.
167- --- @return true | nil
168- --- @return string ? err
166+ --- @return _overload true
167+ --- @return _overload nil , string err
169168function file :flush () end
170169
171170---
@@ -234,8 +233,8 @@ function file:read(...) end
234233--- @overload fun ()
235234--- @param whence string | ' set' | ' cur' | ' end'
236235--- @param offset integer
237- --- @return integer ? pos
238- --- @return string ? err
236+ --- @return _overload integer pos
237+ --- @return _overload nil , string err
239238function file :seek (whence , offset ) end
240239
241240---
@@ -261,8 +260,8 @@ function file:setvbuf(mode, size) end
261260--- In case of success, this function returns `file`. Otherwise it returns
262261--- **nil** plus a string describing the error.
263262--- @param ... string | number
264- --- @return file ?
265- --- @return string ? err
263+ --- @return _overload file
264+ --- @return _overload nil , string err
266265function file :write (...) end
267266
268267--- * `io.stderr`: Standard error.
0 commit comments