summaryrefslogtreecommitdiff
path: root/script/vm/infer.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/infer.lua')
-rw-r--r--script/vm/infer.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index 1b0ff800..bf6df2fb 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -50,6 +50,13 @@ local viewNodeSwitch = util.switch()
end)
: case 'table'
: call(function (source, infer)
+ if source.type == 'table' then
+ if #source == 1 and source[1].type == 'varargs' then
+ local node = m.getInfer(source[1]):view()
+ return ('%s[]'):format(node)
+ end
+ end
+
infer._hasTable = true
end)
: case 'function'
@@ -92,6 +99,10 @@ local viewNodeSwitch = util.switch()
return source[1]
end
end)
+ : case 'generic'
+ : call(function (source, infer)
+ return ('<%s>'):format(source.proto[1])
+ end)
: case 'doc.generic.name'
: call(function (source, infer)
return ('<%s>'):format(source[1])