Skip to content

Commit 09420b7

Browse files
committed
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.
1 parent 677fac0 commit 09420b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

meta/template/math.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
math = {}
1616

1717
---#DES 'math.abs'
18-
---@param x number
19-
---@return number
18+
---@generic Number: number
19+
---@param x Number
20+
---@return Number
2021
---@nodiscard
2122
function math.abs(x) end
2223

0 commit comments

Comments
 (0)