From 5e3f203d76473e2ade05cfd344f2dc6608d65e1a 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, 19 Nov 2021 16:12:51 +0800 Subject: fix #798 --- test/type_inference/init.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 908d613c..5526d6d8 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -943,3 +943,19 @@ local x = 1 ]] + +TEST 'any' [[ +---@return number +local function f(x) + local = x() +end +]] + +TEST 'any' [[ +local mt + +---@return number +function mt:f() end + +local = mt() +]] -- cgit v1.2.3 From 6cf88ae11ac842453cca5936fe6c105076745e55 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, 19 Nov 2021 16:19:53 +0800 Subject: fix #806 --- test/type_inference/init.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 5526d6d8..6d5a57dd 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -959,3 +959,31 @@ function mt:f() end local = mt() ]] + +TEST 'any' [[ +local + +---@class X +function mt:f(x) end +]] + +TEST 'any' [[ +local mt + +---@class X +function mt:f() end +]] + +TEST 'any' [[ +local + +---@type number +function mt:f(x) end +]] + +TEST 'any' [[ +local mt + +---@type number +function mt:f() end +]] -- cgit v1.2.3