### How are you using the lua-language-server? Visual Studio Code Extension (sumneko.lua) ### Which OS are you using? Windows ### What is the issue affecting? Type Checking, Diagnostics/Syntax Checking ### Expected Behaviour I expect both methods to report the "need check nil" diagnostic: ```lua ---@class Y ---@field z string ---@class X ---@field y Y? local X = {} function X:no_warning() print(self.y.z) -- no diagnostics end function X:warning() local y = self.y print(y.z) -- need-check-nil end ``` ### Actual Behaviour The potential problem is only reported when using a local variable. ### Reproduction steps Try the code above. and note how only the first method (`no_warning`) works without any diagnostics. ### Additional Notes _No response_ ### Log File _No response_
Activity
carlos-algms commentedon Mar 9, 2026
Please, are there any plans to implement this feature?
This increases a lot the confidence in the type-checker 🙏🏻