summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/vm/compiler.lua2
-rw-r--r--test/type_inference/init.lua7
3 files changed, 9 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 451a1b96..4e457622 100644
--- a/changelog.md
+++ b/changelog.md
@@ -9,6 +9,7 @@
* `FIX` [#1269](https://github.com/sumneko/lua-language-server/issues/1269)
* `FIX` [#1273](https://github.com/sumneko/lua-language-server/issues/1273)
* `FIX` [#1275](https://github.com/sumneko/lua-language-server/issues/1275)
+* `FIX` [#1279](https://github.com/sumneko/lua-language-server/issues/1279)
## 3.4.0
`2022-6-29`
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 1936fc75..cb54b054 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -663,7 +663,7 @@ function vm.compileByParentNode(source, key, ref, pushResult)
---@cast node vm.global
and not guide.isBasicType(node.name)
)
- or node.type == 'doc.type.string' then
+ or guide.isLiteral(node) then
searchFieldSwitch(node.type, suri, node, key, ref, function (res, markDoc)
if markDoc then
docedResults[#docedResults+1] = res
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 7fa6ec7c..a934a85d 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3357,3 +3357,10 @@ local t
<?t?> = {}
]]
+
+TEST 'integer' [[
+---@type integer[]|A
+local t
+
+local <?x?> = t[1]
+]]