summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/vm/function.lua4
-rw-r--r--test/diagnostics/common.lua8
2 files changed, 12 insertions, 0 deletions
diff --git a/script/vm/function.lua b/script/vm/function.lua
index 6c07acf6..9efcbd32 100644
--- a/script/vm/function.lua
+++ b/script/vm/function.lua
@@ -29,6 +29,10 @@ function vm.countParamsOfFunction(func)
local arg = func.args[i]
if arg.type == '...' then
max = math.huge
+ elseif arg.type == 'self'
+ and i == 1 then
+ min = i
+ break
elseif getDocParam(arg)
and not vm.compileNode(arg):isNullable() then
min = i
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua
index e6bc86ef..1f8a782d 100644
--- a/test/diagnostics/common.lua
+++ b/test/diagnostics/common.lua
@@ -1695,3 +1695,11 @@ local t
local n = t:upper()
]]
+
+TEST [[
+local t = {}
+
+function t:init() end
+
+<!t.init()!>
+]]