From e98245ae3492ce132ddfe9153b1a5a80f3a3e3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 26 Jun 2019 15:34:13 +0800 Subject: =?UTF-8?q?=E8=AE=B0=E5=BD=95=20overload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/function.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'server/src/vm/function.lua') diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua index 60498033..8f7ac6c2 100644 --- a/server/src/vm/function.lua +++ b/server/src/vm/function.lua @@ -465,7 +465,7 @@ function mt:markGlobal() end end -function mt:setEmmy(params, returns) +function mt:setEmmy(params, returns, overLoads) if params then self._emmyParams = params for _, param in ipairs(params) do @@ -479,6 +479,12 @@ function mt:setEmmy(params, returns) rtn:getSource():set('emmy function', self) end end + if overLoads then + self._emmyOverLoads = overLoads + for _, ol in ipairs(overLoads) do + ol:getSource():set('emmy function', self) + end + end end ---@param comment string @@ -495,6 +501,10 @@ function mt:getEmmyParams() return self._emmyParams end +function mt:getEmmyOverLoads() + return self._emmyOverLoads +end + local function create(source) if not source then error('Function need source') -- cgit v1.2.3