File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 6
6
* ` FIX ` [ #1887 ]
7
7
* ` FIX ` [ #1889 ]
8
8
* ` FIX ` [ #1895 ]
9
+ * ` FIX ` [ #1902 ]
9
10
10
11
[ #1886 ] : https://github.com/LuaLS/lua-language-server/issues/1886
11
12
[ #1887 ] : https://github.com/LuaLS/lua-language-server/issues/1887
12
13
[ #1889 ] : https://github.com/LuaLS/lua-language-server/issues/1889
13
14
[ #1895 ] : https://github.com/LuaLS/lua-language-server/issues/1895
15
+ [ #1902 ] : https://github.com/LuaLS/lua-language-server/issues/1902
14
16
15
17
## 3.6.10
16
18
` 2023-2-7 `
Original file line number Diff line number Diff line change @@ -641,7 +641,8 @@ local lookIntoChild = util.switch()
641
641
and handler .args [1 ]
642
642
and tracer .getMap [handler .args [1 ]] then
643
643
-- if type(x) == 'string' then
644
- tracer :lookIntoChild (handler , topNode :copy ())
644
+ tracer :lookIntoChild (handler , topNode )
645
+ topNode = topNode :copy ()
645
646
if action .op .type == ' ==' then
646
647
topNode :narrow (tracer .uri , checker [1 ])
647
648
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
1201
1201
some_fn { { "test" } } -- <- diagnostic: "Cannot assign `table` to `string`."
1202
1202
]]
1203
1203
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
+
1204
1214
config .remove (nil , ' Lua.diagnostics.disable' , ' unused-local' )
1205
1215
config .remove (nil , ' Lua.diagnostics.disable' , ' unused-function' )
1206
1216
config .remove (nil , ' Lua.diagnostics.disable' , ' undefined-global' )
You can’t perform that action at this time.
0 commit comments