Skip to content

Commit 6de89c6

Browse files
committed
Skip boolean literals in boolean-context warnings
1 parent b1bba09 commit 6de89c6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

script/core/diagnostics/boolean-context.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ local function checkExpression(source, uri, callback)
5656
if not source then
5757
return
5858
end
59+
local infer = vm.getInfer(source)
60+
local onlyBoolean = isBooleanOnly(infer, uri)
61+
if onlyBoolean == true or onlyBoolean == nil then
62+
return
63+
end
5964
local node = vm.compileNode(source)
6065
local truthiness = getTruthiness(node)
6166
if truthiness then
@@ -66,11 +71,6 @@ local function checkExpression(source, uri, callback)
6671
}
6772
return
6873
end
69-
local infer = vm.getInfer(source)
70-
local onlyBoolean = isBooleanOnly(infer, uri)
71-
if onlyBoolean == true or onlyBoolean == nil then
72-
return
73-
end
7474
callback {
7575
start = source.start,
7676
finish = source.finish,

0 commit comments

Comments
 (0)