From 50832a63579ba96587a8bd9bcf408302cea808e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 13 May 2021 20:28:55 +0800 Subject: fix --- test/definition/luadoc.lua | 4 ++-- test/type_inference/init.lua | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua index d0d95847..86366752 100644 --- a/test/definition/luadoc.lua +++ b/test/definition/luadoc.lua @@ -547,8 +547,8 @@ local v1 local function pairs(t) end for k, v in pairs(v1) do - print(k.) - print(v.bar1) + print(k.bar1) + print(v.) end ]] diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 95933b8d..3de36e5e 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -243,8 +243,10 @@ local function f(, b) end ]] -TEST 'string' [[ ----@return string +TEST 'A' [[ +---@class A + +---@return A local function f2() end local function f() @@ -266,14 +268,6 @@ local = f() --setmetatable() --]] -TEST 'function' [[ -string.() -]] - -TEST 'function' [[ -(''):() -]] - -- 不根据对方函数内的使用情况来推测 TEST 'any' [[ local function x(a) @@ -325,16 +319,23 @@ local ]] TEST 'string' [[ +---@class string + ---@type string local ]] TEST 'string[]' [[ +---@class string + ---@type string[] local ]] TEST 'string|table' [[ +---@class string +---@class table + ---@type string | table local ]] @@ -350,6 +351,9 @@ local ]] TEST 'table' [[ +---@class string +---@class number + ---@type table local ]] -- cgit v1.2.3