Skip to content

Commit cc3cd66

Browse files
committed
chore(types): improve generic self typing
1 parent c6fcecb commit cc3cd66

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

types/List.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ function List:any(pred) end
5151
---local l = List({ "a" }):append("b")
5252
----- result: { "a", "b" }
5353
---```
54-
---@param self mods.List|any[]
54+
---@generic T:mods.List|any[]
55+
---@param self T
5556
---@return T self
5657
function List:append(v) end
5758

@@ -314,7 +315,8 @@ function List:last() end
314315
---local d = List({ "a", "b", "c" }):difference({ "b" })
315316
----- result: { "a", "c" }
316317
---```
317-
---@param self mods.List|any[]
318+
---@generic T:mods.List|any[]
319+
---@param self T
318320
---@return T ls
319321
---@nodiscard
320322
function List:difference(ls) end

0 commit comments

Comments
 (0)