diff options
author | C3pa <41503714+C3pa@users.noreply.github.com> | 2023-03-01 21:35:36 +0100 |
---|---|---|
committer | C3pa <41503714+C3pa@users.noreply.github.com> | 2023-03-01 21:35:36 +0100 |
commit | 09420b72cd1548f09886d940a2c9c4eba79bdb42 (patch) | |
tree | ee4c59f7cbd9d00bfe2f03b553fc67dbf609c9c2 /meta/template | |
parent | 677fac00286628af29a1a24c11a0d6de7d8afe0d (diff) | |
download | lua-language-server-09420b72cd1548f09886d940a2c9c4eba79bdb42.zip |
Improve math.abs annotation
This brings it in line with math.max, and max.min. This change allows the type inference to correctly infer the returned type if math.abs is passed an integer as an argument.
Diffstat (limited to 'meta/template')
-rw-r--r-- | meta/template/math.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/template/math.lua b/meta/template/math.lua index 07917a2b..37e1d5c7 100644 --- a/meta/template/math.lua +++ b/meta/template/math.lua @@ -15,8 +15,9 @@ math = {} ---#DES 'math.abs' ----@param x number ----@return number +---@generic Number: number +---@param x Number +---@return Number ---@nodiscard function math.abs(x) end |