Closed
Description
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?
Diagnostics/Syntax Checking
Expected Behaviour
Diagnostics nil check does not depend on the field parameter value
---@class A
---@field b string
---@type A?
local a
if a.b == "string1" then end -- Need check nil
if a.b == "string" then end -- Need check nil
Actual Behaviour
The string value "string" suppresses the triggering of diagnostics, because of type string
of field b.
Reproduction steps
- Copy the sample code
- Check the diagnostics
a.b == "string"
when a should trigger "Need check nil"
Additional Notes
No response
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels