diff options
Diffstat (limited to 'test/diagnostics/init.lua')
-rw-r--r-- | test/diagnostics/init.lua | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index 5fdc3891..c593968e 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -76,7 +76,7 @@ local <!x!> ]] TEST [[ -local x <close> +local x <close> = print ]] TEST [[ @@ -319,6 +319,16 @@ return [[ ]] ]=] +config.config.diagnostics.disable['close-non-object'] = true +TEST [[ +local _ <close> = function () end +]] + +config.config.diagnostics.disable['close-non-object'] = nil +TEST [[ +local _ <close> = <!1!> +]] + config.config.diagnostics.disable['unused-local'] = true TEST [[ local f = <!function () end!> @@ -824,10 +834,6 @@ TEST [[ local t ]] -TEST [[ -local _ <close> = function () end -]] - -- checkUndefinedField 通用 TEST [[ ---@class Foo @@ -947,6 +953,15 @@ v2:method2() -- 这个感觉实际应该报错更合适 ]] TEST [[ +---@type table +T1 = {} +print(T1.f1) +---@type table* +T2 = {} +print(T2.<!f2!>) +]] + +TEST [[ ---@generic T ---@param arg1 T ---@return T |