diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-23 00:42:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-23 00:42:10 +0800 |
commit | ec1f746a71dfb981f093bf00322db75d559fd6b6 (patch) | |
tree | 71730d2de455bf7cd8a9481a554a56cddf47f341 /script/vm/node.lua | |
parent | 6e00db5b51646ad91c5ee5598897cad7f8d65915 (diff) | |
download | lua-language-server-ec1f746a71dfb981f093bf00322db75d559fd6b6.zip |
fix optional parameters
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r-- | script/vm/node.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua index 92604c3c..b57fa80b 100644 --- a/script/vm/node.lua +++ b/script/vm/node.lua @@ -100,9 +100,13 @@ function mt:isNullable() if self.optional then return true end + if #self == 0 then + return true + end for _, c in ipairs(self) do if c.type == 'nil' - or (c.type == 'global' and c.cate == 'type' and c.name == 'nil') then + or (c.type == 'global' and c.cate == 'type' and c.name == 'nil') + or (c.type == 'global' and c.cate == 'type' and c.name == 'any') then return true end end |