Skip to content

Commit 7ef36fa

Browse files
committed
fix #1928
1 parent 2704d39 commit 7ef36fa

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
* `FIX` [#1914]
77
* `FIX` [#1922]
88
* `FIX` [#1924]
9+
* `FIX` [#1928]
910

1011
[#1715]: https://github.com./LuaLS/lua-language-server/issues/1715
1112
[#1753]: https://github.com./LuaLS/lua-language-server/issues/1753
1213
[#1914]: https://github.com./LuaLS/lua-language-server/issues/1914
1314
[#1922]: https://github.com./LuaLS/lua-language-server/issues/1922
1415
[#1924]: https://github.com./LuaLS/lua-language-server/issues/1924
16+
[#1928]: https://github.com./LuaLS/lua-language-server/issues/1928
1517

1618
## 3.6.13
1719
`2023-3-2`

script/vm/compiler.lua

+1
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,7 @@ local compilerSwitch = util.switch()
13571357
if src.type == 'doc.field'
13581358
or src.type == 'doc.type.field'
13591359
or src.type == 'doc.type.name'
1360+
or src.type == 'doc.type'
13601361
or guide.isLiteral(src) then
13611362
hasMarkDoc = true
13621363
vm.setNode(source, vm.compileNode(src))

test/diagnostics/type-check.lua

+14
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,20 @@ Class.staticCreator(<!true!>)
12241224
Class<!:!>staticCreator() -- Expecting a waring
12251225
]]
12261226

1227+
TESTWITH 'assign-type-mismatch' [[
1228+
---@type string[]
1229+
local arr = {
1230+
<!3!>,
1231+
}
1232+
]]
1233+
1234+
TESTWITH 'assign-type-mismatch' [[
1235+
---@type (string|boolean)[]
1236+
local arr2 = {
1237+
<!3!>, -- no warnings
1238+
}
1239+
]]
1240+
12271241
config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
12281242
config.remove(nil, 'Lua.diagnostics.disable', 'unused-function')
12291243
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')

0 commit comments

Comments
 (0)