summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/vm/compiler.lua6
-rw-r--r--test/definition/luadoc.lua10
2 files changed, 15 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 1efe8abb..b0694a4b 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -375,7 +375,11 @@ function vm.getClassFields(suri, object, key, ref, pushResult)
if not searchedFields[fieldKey]
and guide.isSet(field)
and field.value then
- if guide.isLiteral(field.value) then
+ if vm.getLocalID(field)
+ and vm.getLocalID(field) == vm.getLocalID(field.value) then
+ elseif src._globalNode
+ and src._globalNode == field.value._globalNode then
+ else
hasFounded[fieldKey] = true
end
pushResult(field, true)
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index afa53227..2da10f93 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -922,4 +922,14 @@ f {
}
]]
+TEST [[
+---@class A
+local a
+a.__index = a
+
+---@class B: A
+local <!b!>
+b.<!<?__index?>!> = b
+]]
+
config.set(nil, 'Lua.type.castNumberToInteger', true)