diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-23 19:42:37 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-23 19:42:37 +0800 |
commit | 30570630339f3a3ce19329d045ac0eb42627d3b9 (patch) | |
tree | c1de514fdd573ac9c1401ff974e9c28ca9457a80 /script/vm/node.lua | |
parent | 5381bf4da77eb7903f8294d9cf177480f5590499 (diff) | |
download | lua-language-server-30570630339f3a3ce19329d045ac0eb42627d3b9.zip |
infer by `x == nil` and `x ~= nil`
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r-- | script/vm/node.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua index b759ed72..8dd0c7f7 100644 --- a/script/vm/node.lua +++ b/script/vm/node.lua @@ -71,7 +71,7 @@ function mt:addOptional() end function mt:removeOptional() - self.optional = false + self:remove 'nil' end ---@return boolean @@ -187,6 +187,9 @@ end ---@param name string function mt:remove(name) + if name == 'nil' and self.optional == true then + self.optional = nil + end local index = 0 while true do index = index + 1 |