File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 66* ` FIX ` [ #1887 ]
77* ` FIX ` [ #1889 ]
88* ` FIX ` [ #1895 ]
9+ * ` FIX ` [ #1902 ]
910
1011[ #1886 ] : https://github.com/LuaLS/lua-language-server/issues/1886
1112[ #1887 ] : https://github.com/LuaLS/lua-language-server/issues/1887
1213[ #1889 ] : https://github.com/LuaLS/lua-language-server/issues/1889
1314[ #1895 ] : https://github.com/LuaLS/lua-language-server/issues/1895
15+ [ #1902 ] : https://github.com/LuaLS/lua-language-server/issues/1902
1416
1517## 3.6.10
1618` 2023-2-7 `
Original file line number Diff line number Diff line change @@ -641,7 +641,8 @@ local lookIntoChild = util.switch()
641641 and handler .args [1 ]
642642 and tracer .getMap [handler .args [1 ]] then
643643 -- if type(x) == 'string' then
644- tracer :lookIntoChild (handler , topNode :copy ())
644+ tracer :lookIntoChild (handler , topNode )
645+ topNode = topNode :copy ()
645646 if action .op .type == ' ==' then
646647 topNode :narrow (tracer .uri , checker [1 ])
647648 if outNode then
Original file line number Diff line number Diff line change @@ -1201,6 +1201,16 @@ local function some_fn(some_param) return end
12011201some_fn { { "test" } } -- <- diagnostic: "Cannot assign `table` to `string`."
12021202]]
12031203
1204+ TEST [[
1205+ ---@param p integer|string
1206+ local function get_val(p)
1207+ local is_number = type(p) == 'number'
1208+ return is_number and p or p
1209+ end
1210+
1211+ get_val('hi')
1212+ ]]
1213+
12041214config .remove (nil , ' Lua.diagnostics.disable' , ' unused-local' )
12051215config .remove (nil , ' Lua.diagnostics.disable' , ' unused-function' )
12061216config .remove (nil , ' Lua.diagnostics.disable' , ' undefined-global' )
You can’t perform that action at this time.
0 commit comments