summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-16 15:23:12 +0800
committersumneko <sumneko@hotmail.com>2019-04-16 15:23:12 +0800
commit20b609862d1536b1aa6befdca3eef9dedb58fc91 (patch)
treeee23bdf964a39ce2c54b6fe0ea7770d0fdee809c
parentbd38c1bd2ceed3121d86ff99f73dbf4815ed18e7 (diff)
downloadlua-language-server-20b609862d1536b1aa6befdca3eef9dedb58fc91.zip
修正值类型优先级失效的bug
-rw-r--r--server/src/vm/value.lua4
-rw-r--r--server/test/hover/init.lua2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index d765883e..425cc0b2 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -84,8 +84,8 @@ function mt:getType()
mRate = rate
mType = tp
elseif rate == mRate then
- local level1 = TypeLevel[rate] or 0.0
- local level2 = TypeLevel[mRate] or 0.0
+ local level1 = TypeLevel[tp] or 0.0
+ local level2 = TypeLevel[mType] or 0.0
if level1 > level2 then
mRate = rate
mType = tp
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index 6db4a1c0..78ce0546 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -249,7 +249,7 @@ TEST [[
for <?c?> in io.lines() do
end
]]
-[[local c: number]]
+[[local c: string]]
TEST [[
local function f()