Skip to content

Commit 5e9e75b

Browse files
committed
fix
1 parent 74e8cdc commit 5e9e75b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

script/vm/compiler.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ local searchFieldSwitch = util.switch()
211211
end)
212212
: case 'doc.type.table'
213213
: call(function (suri, source, key, ref, pushResult)
214+
if type(key) == 'string' and key:find(vm.ID_SPLITE) then
215+
return
216+
end
214217
for _, field in ipairs(source.fields) do
215218
local fieldKey = field.name
216219
if fieldKey.type == 'doc.type' then

test/hover/init.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,3 +2380,16 @@ local obj: B {
23802380
get: function,
23812381
}
23822382
]]
2383+
2384+
TEST [[
2385+
---@class A
2386+
---@field x fun(): string
2387+
2388+
---@type table<string, A>
2389+
local obj
2390+
2391+
local x = obj[''].<?x?>()
2392+
]]
2393+
[[
2394+
(field) A.x: fun():string
2395+
]]

0 commit comments

Comments
 (0)