diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-05 18:04:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-05 18:04:27 +0800 |
commit | 61304827140ac8940e74ce9876c772d021cc926a (patch) | |
tree | 32508a8c8b1c1200a3c0629e46af3af59cb1b8fe /script-beta/vm | |
parent | 14f38cf2671ce044dd2ee752b3d66dbbaf7b83aa (diff) | |
download | lua-language-server-61304827140ac8940e74ce9876c772d021cc926a.zip |
修正报错
Diffstat (limited to 'script-beta/vm')
-rw-r--r-- | script-beta/vm/getValue.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/script-beta/vm/getValue.lua b/script-beta/vm/getValue.lua index f6b3ff53..bde3fad2 100644 --- a/script-beta/vm/getValue.lua +++ b/script-beta/vm/getValue.lua @@ -593,6 +593,15 @@ local function checkLibraryArg(source) } end +local function hasTypeInResults(results, type) + for i = 1, #results do + if results[i].type == 'type' then + return true + end + end + return false +end + local function inferByUnary(results, source) if #results ~= 0 then return @@ -603,6 +612,11 @@ local function inferByUnary(results, source) end local op = parent.op if op.type == '#' then + -- 会受顺序影响,不检查了 + --if hasTypeInResults(results, 'string') + --or hasTypeInResults(results, 'integer') then + -- return + --end insert(results, { type = 'string', source = source |