Replies: 2 comments 1 reply
-
I don't think there's an easy way to change ---@generic T
---@param arr T[]
---@param value T
local function my_insert(arr, value)
table.insert(arr, value)
end but unfortunately it looks like the language server doesn't check generic parameter types. :( You can always open an issue to get that implemented if no one else has better ideas. |
Beta Was this translation helpful? Give feedback.
-
I know the It is defined as: table.insert(table, position, value) But of course, the following is also valid, but never narrowed down to: table.insert(table, value) I know better narrowing of functions has been talked about in various places, so that will hopefully be fixed. |
Beta Was this translation helpful? Give feedback.
-
If I have a setup like so:
Is there a way to get the language server to warn me about the non-conforming value?
I also tried defining a class with all the appropriate fields and typing
values
to that class.Beta Was this translation helpful? Give feedback.
All reactions