summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-07 00:07:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-07 00:07:28 +0800
commit01a09c66af04ab3e37d02782721c20bff8092e15 (patch)
tree5a2eb28be3c347f7e62772d24b0f16993ca36007 /script
parentd1fd05ec4b174693827cc4cae68a0cac2583c599 (diff)
downloadlua-language-server-01a09c66af04ab3e37d02782721c20bff8092e15.zip
some fix
Diffstat (limited to 'script')
-rw-r--r--script/config/template.lua11
-rw-r--r--script/vm/compiler.lua3
2 files changed, 7 insertions, 7 deletions
diff --git a/script/config/template.lua b/script/config/template.lua
index e928db78..4e2f45ae 100644
--- a/script/config/template.lua
+++ b/script/config/template.lua
@@ -5,6 +5,11 @@ local diag = require 'proto.diagnostic'
---@class config.unit
---@field caller function
---@field _checker fun(self: config.unit, value: any): boolean
+---@field name string
+---@field [string] config.unit
+---@operator shl: config.unit
+---@operator shr: config.unit
+---@operator call: config.unit
local mt = {}
mt.__index = mt
@@ -52,11 +57,7 @@ local function register(name, default, checker, loader, caller)
}
end
----@class config.template
----@field [string] config.template
----@operator shl: config.template
----@operator shr: config.template
----@operator call: config.template
+---@type config.unit
local Type = setmetatable({}, { __index = function (_, name)
local unit = {}
for k, v in pairs(units[name]) do
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index a9cd50cd..995fe395 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -295,8 +295,7 @@ function vm.getClassFields(suri, object, key, ref, pushResult)
hasFounded[fieldKey] = true
end
end
- end
- if not hasFounded[fieldKey] then
+ elseif key and not hasFounded[key] then
local keyType = type(key)
if keyType == 'table' then
-- ---@field [integer] boolean -> class[integer]