diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 10:21:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 10:21:31 +0800 |
commit | 0579771df784cbfbe1dcc824c62e06782a803cef (patch) | |
tree | c6b087712c3ccc94597e13772a3df142beb7fc41 /server | |
parent | 18843ec7abbc146dbf2a895e258175541fd0a8a8 (diff) | |
download | lua-language-server-0579771df784cbfbe1dcc824c62e06782a803cef.zip |
修正一个bug
Diffstat (limited to 'server')
-rw-r--r-- | server/src/core/value.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/server/src/core/value.lua b/server/src/core/value.lua index 61882175..e7ba547b 100644 --- a/server/src/core/value.lua +++ b/server/src/core/value.lua @@ -13,6 +13,12 @@ function mt:getValue() end function mt:inference(tp, rate) + if type(tp) == 'table' then + for _, ctp in ipairs(tp) do + self:inference(ctp, rate) + end + return + end if tp == '...' then error('Value type cant be ...') end @@ -143,7 +149,7 @@ function mt:getField(name, source, stack) return field end -function mt:eachField(callback) +function mt:rawEachField(callback) if not self._child then return nil end @@ -162,12 +168,16 @@ function mt:eachField(callback) return nil end +function mt:eachField(callback) + return self:rawEachField(callback) +end + function mt:removeUri(uri) if not self._child then return end self._child[uri] = nil - self:eachField(function (field) + self:rawEachField(function (field) if field.value then field.value:removeUri(uri) end |