How to type this so Sumneko is happy #1616
-
I have the below code and it warns me that the last line has the below error:
Code:
I've tried adding In my real code the value of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you are going to be assigning random key names that can not be foreseen (and therefor documented with ---@type table<string, any>
local x = {
name = "me",
nickName = "M"
}
local fieldName = "name"
x[fieldName] = nil |
Beta Was this translation helpful? Give feedback.
If you are going to be assigning random key names that can not be foreseen (and therefor documented with
@field
), you will have to do the following: