Skip to content

Commit 69c992d

Browse files
authored
Merge branch 'master' into inconsistent-behavior-(missing-fields)
2 parents 7582afd + 7d06e55 commit 69c992d

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,8 +12,9 @@
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+
* `FIX` Inconsistent type narrow behavior of function call args [#2758](https://github.com/LuaLS/lua-language-server/issues/2758)
1516
* `FIX` Improve the `missing-fields` logic to be able to correctly handle classes defined several times [#22770](https://github.com/LuaLS/lua-language-server/pull/2770)
16-
17+
*
1718
## 3.9.3
1819
`2024-6-11`
1920
* `FIX` Sometimes providing incorrect autocompletion when chaining calls

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)