summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/core/noder.lua2
-rw-r--r--test/type_inference/init.lua5
3 files changed, 7 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index b359cf85..68ccd4dd 100644
--- a/changelog.md
+++ b/changelog.md
@@ -4,6 +4,7 @@
* `NEW` `VSCode`: click the status bar icon to operate:
* run workspace diagnostics
* `FIX` `debug.getuservalue` and `debug.setuservalue` should not exist in `Lua 5.1`
+* `FIX` infer of `class[][]`
## 2.2.3
`2021-7-9`
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 54fc484c..28a547bb 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -231,7 +231,7 @@ local function getKey(source)
elseif source.type == 'doc.type.field' then
return 'dfield:' .. source.start
elseif source.type == 'doc.type.array' then
- return 'darray:' .. source.start
+ return 'darray:' .. source.finish
elseif source.type == 'doc.type.function' then
return 'dfun:' .. source.start, nil
elseif source.type == 'doc.see.field' then
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 77440cf6..b5d4db16 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -889,3 +889,8 @@ local t
<?t?>:getOwner()
]]
+
+TEST 'string[][]' [[
+---@type string[][]
+local <?t?>
+]]