Skip to content

Commit abd5daa

Browse files
authored
Merge branch 'master' into cast-table-to-class
2 parents b7c5809 + 7d06e55 commit abd5daa

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
* `NEW` added lua regular expression support for Lua.doc.<scope>Name [#2753](https://github.com/LuaLS/lua-language-server/pull/2753)
1313
* `FIX` Bad triggering of the `inject-field` diagnostic, when the fields are declared at the creation of the object [#2746](https://github.com/LuaLS/lua-language-server/issues/2746)
1414
* `CHG` Change spacing of parameter inlay hints to match other LSPs, like `rust-analyzer`
15-
* `NEW` Add matching checks between the shape of tables and classes, during type checking. [#2768](https://github.com/LuaLS/lua-language-server/pull/2768)
15+
* `FIX` Inconsistent type narrow behavior of function call args [#2758](https://github.com/LuaLS/lua-language-server/issues/2758)
16+
* `NEW` Add matching checks between the shape of tables and classes, during type checking. [#2768](https://github.com/LuaLS/lua-language-server/pull/2768
1617

1718
## 3.9.3
1819
`2024-6-11`

script/vm/compiler.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,12 @@ local function matchCall(source)
575575
newNode:removeNode(needRemove)
576576
newNode.originNode = myNode
577577
vm.setNode(source, newNode, true)
578+
if call.args then
579+
-- clear node caches of args to allow recomputation with the type narrowed call
580+
for _, arg in ipairs(call.args) do
581+
vm.removeNode(arg)
582+
end
583+
end
578584
end
579585
end
580586

0 commit comments

Comments
 (0)