From 035143c078f9e87b92a909b415d4d060db155604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 15 Mar 2019 13:39:25 +0800 Subject: =?UTF-8?q?=E5=BA=93=E5=87=BD=E6=95=B0=E8=BF=94=E5=9B=9E=E5=B8=B8?= =?UTF-8?q?=E9=87=8F=E6=97=B6=E4=BD=BF=E7=94=A8=E6=96=B0=E5=BB=BA=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/vm.lua | 3 +++ server/test/definition/bug.lua | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'server') diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index 4a0250f1..555154b3 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -288,6 +288,9 @@ function mt:callLibrary(func, values, source, lib) if rtn.type == '...' then --func:getReturn(i):setType('any', 0.0) else + if rtn.type == 'boolean' or rtn.type == 'number' or rtn.type == 'integer' or rtn.type == 'string' then + func:setReturn(i, self:createValue(rtn.type, self:getDefaultSource())) + end func:getReturn(i):setType(rtn.type or 'any', 1.0) end end diff --git a/server/test/definition/bug.lua b/server/test/definition/bug.lua index b5e8dbe9..1d3ab02c 100644 --- a/server/test/definition/bug.lua +++ b/server/test/definition/bug.lua @@ -83,3 +83,8 @@ local a local return f(), ]] + +TEST [[ +local a = os.clock() +local ?> = os.clock() +]] -- cgit v1.2.3