diff options
-rw-r--r-- | changelog.md | 3 | ||||
-rw-r--r-- | script/vm/runner.lua | 2 | ||||
-rw-r--r-- | test/type_inference/init.lua | 10 |
3 files changed, 15 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 7f381afd..5d5de00a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 3.3.1 +* `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215) + ## 3.3.0 `2022-6-15` * `NEW` `LuaDoc` supports `` `CODE` `` diff --git a/script/vm/runner.lua b/script/vm/runner.lua index 43cbd155..793b4417 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -294,6 +294,8 @@ function mt:_lookInto(action, topNode, outNode) self:_lookInto(arg, topNode) end end + elseif action.type == 'paren' then + topNode, outNode = self:_lookInto(action.exp, topNode, outNode) else guide.eachSourceContain(action, top.finish, function(source) self:_lookInto(source, topNode) diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 3e4a910c..8201f9d4 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2627,3 +2627,13 @@ if tp == 'integer' then print(<?x?>) end ]] + +TEST 'integer' [[ +---@type integer? +local x + +if (x == nil) then +else + print(<?x?>) +end +]] |