summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/hover/label.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua
index c3607415..cc2cdd09 100644
--- a/script-beta/core/hover/label.lua
+++ b/script-beta/core/hover/label.lua
@@ -22,9 +22,9 @@ local function asValue(source, title)
local type = 'any'
local literal = ''
local cont
- local values = vm.getInfers(source)
- if values then
- for _, value in ipairs(values) do
+ local infers = vm.getInfers(source)
+ if infers then
+ for _, value in ipairs(infers) do
local src = value.source
local tp = value.type
class = guide.mergeTypes {class, vm.getClass(src)}
@@ -54,10 +54,12 @@ local function asValue(source, title)
pack[#pack+1] = name .. ':'
if cont then
type = nil
+ end
+ if class == 'any' then
+ pack[#pack+1] = type
else
- type = type or 'any'
+ pack[#pack+1] = class
end
- pack[#pack+1] = class or type
if literal ~= '' then
pack[#pack+1] = '='
pack[#pack+1] = literal