Why won't lua_ls
report any errors when writting extra fields in the variable declaration?
#2595
-
I wrote my code like this, but ---@class test
---@field abc any
---@type test
local a = {
def = 10,
} And only when I try to access the variable like |
Beta Was this translation helpful? Give feedback.
Answered by
carsakiller
Apr 3, 2024
Replies: 1 comment
-
I think you are looking for an exact class. Marking a class as exact should raise a warning when trying to inject fields. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nullptr-yxw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you are looking for an exact class. Marking a class as exact should raise a warning when trying to inject fields.