Skip to content

Commit 323cce7

Browse files
authored
Merge pull request #284 from lewis6991/fix/stdoverlo
fix: stdlib remove some overloads
2 parents db2607d + 7ba0a17 commit 323cce7

6 files changed

Lines changed: 3 additions & 13 deletions

File tree

crates/emmylua_code_analysis/resources/std/global.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ function collectgarbage(opt, ...) end
7373
--- (`stdin`). Returns all values returned by the chunk. In case of errors,
7474
--- `dofile` propagates the error to its caller (that is, `dofile` does not run
7575
--- in protected mode).
76-
---@overload fun():table
77-
---@param filename string
76+
---@param filename? string
7877
---@return table
7978
function dofile(filename) end
8079

crates/emmylua_code_analysis/resources/std/io.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,8 @@ function file:seek(whence, offset) end
249249
---
250250
--- For the last two cases, `size` specifies the size of the buffer, in
251251
--- bytes. The default is an appropriate size.
252-
---@overload fun(mode:string)
253252
---@param mode string | 'no' | 'full' | 'line'
254-
---@param size integer
253+
---@param size? integer
255254
function file:setvbuf(mode, size) end
256255

257256
---

crates/emmylua_code_analysis/resources/std/math.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ function math.asin(x) end
4242
---
4343
--- The default value for `x` is 1, so that the call `math.atan(y)`` returns the
4444
--- arc tangent of `y`.
45-
---@overload fun(y:number):number
4645
---@param y number
47-
---@param x number
46+
---@param x? number
4847
---@return number
4948
function math.atan(y, x) end
5049

@@ -94,7 +93,6 @@ math.huge = nil
9493
---
9594
--- Returns the logarithm of `x` in the given base. The default for `base` is
9695
--- *e* (so that the function returns the natural logarithm of `x`).
97-
---@overload fun(x:number):number
9896
---@param x number
9997
---@param base? number
10098
---@return number

crates/emmylua_code_analysis/resources/std/os.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ function os.rename(oldname, newname) end
176176
---
177177
--- This function may be not thread safe because of its reliance on C function
178178
--- `setlocale`.
179-
---@overload fun(locale:string):string?
180179
---@param locale string
181180
---@param category? string
182181
---@return string|nil

crates/emmylua_code_analysis/resources/std/package.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ package.searchers = {}
163163
--- Returns the resulting name of the first file that it can open in read mode
164164
--- (after closing the file), or **nil** plus an error message if none succeeds.
165165
--- (This error message lists all file names it tried to open.)
166-
---@overload fun(name:string, path:string):string
167166
---@param name string
168167
---@param path? string
169168
---@param sep? string

crates/emmylua_code_analysis/resources/std/string.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ string = {}
2828
--- `string.sub`.
2929
---
3030
--- Note that numerical codes are not necessarily portable across platforms.
31-
---@overload fun(s:string):integer
3231
---@param s string
3332
---@param i? integer
3433
---@param j? integer
@@ -191,7 +190,6 @@ function string.gmatch(s, pattern) end
191190
--- `local t = {name="lua", version="5.3"}`
192191
--- `x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)`
193192
--- > x="lua-5.3.tar.gz"
194-
---@overload fun(s:string, pattern:string, repl:string|fun()):string, integer
195193
---@param s string
196194
---@param pattern string
197195
---@param repl string|fun(param:string)
@@ -252,7 +250,6 @@ function string.packsize(fmt) end
252250
---
253251
--- Note that it is very easy to exhaust the memory of your machine with a
254252
--- single call to this function.
255-
---@overload fun(s:string, n:integer):string
256253
---@param s string
257254
---@param n integer
258255
---@param sep? string
@@ -289,7 +286,6 @@ function string.sub(s, i, j) end
289286
--- `fmt`. An optional `pos` marks where to start reading in `s` (default is 1).
290287
--- After the read values, this function also returns the index of the first
291288
--- unread byte in `s`.
292-
---@overload fun(fmt:string, s:string):string
293289
---@param fmt string
294290
---@param s string
295291
---@param pos? integer

0 commit comments

Comments
 (0)