Skip to content

Commit

Permalink
recover mark before return
Browse files Browse the repository at this point in the history
fix #2004
  • Loading branch information
sumneko committed Mar 22, 2023
1 parent b862736 commit 91ae26b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
## 3.6.18
* `FIX` [#1943]
* `FIX` [#1996]
* `FIX` [#2004]
* `FIX` [#2013]

[#1943]: https://github.com/LuaLS/lua-language-server/issues/1943
[#1996]: https://github.com/LuaLS/lua-language-server/issues/1996
[#2004]: https://github.com/LuaLS/lua-language-server/issues/2004
[#2013]: https://github.com/LuaLS/lua-language-server/issues/2013

## 3.6.17
Expand Down
1 change: 1 addition & 0 deletions script/vm/type.lua
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ function vm.isSubType(uri, child, parent, mark, errs)
if ext.type == 'doc.extends.name'
and (not isBasicType or guide.isBasicType(ext[1]))
and vm.isSubType(uri, ext[1], parent, mark, errs) == true then
mark[childName] = nil
return true
end
end
Expand Down
17 changes: 17 additions & 0 deletions test/diagnostics/type-check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,23 @@ local arr2 = {
}
]]

TEST [[
---@class A
---@class B : A
---@class C : B
---@class D : B
---@param x A
local function func(x) end
---@type C|D
local var
func(var)
]]

config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
config.remove(nil, 'Lua.diagnostics.disable', 'unused-function')
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')
Expand Down

0 comments on commit 91ae26b

Please sign in to comment.