Skip to content

Commit 028a533

Browse files
committed
close-non-object don't check unknown
1 parent be85f2c commit 028a533

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

script/core/diagnostics/close-non-object.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ return function (uri, callback)
2828
if not infer:hasClass(uri)
2929
and not infer:hasType(uri, 'nil')
3030
and not infer:hasType(uri, 'table')
31-
and infer:view(uri, 'any') ~= 'any' then
31+
and not infer:hasUnknown(uri)
32+
and not infer:hasAny(uri) then
3233
callback {
3334
start = source.value.start,
3435
finish = source.value.finish,

test/diagnostics/common.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,3 +2000,10 @@ print(1)
20002000
20012001
do return end
20022002
]]
2003+
2004+
TEST [[
2005+
---@type unknown
2006+
local t
2007+
2008+
local _ <close> = t
2009+
]]

0 commit comments

Comments
 (0)