summaryrefslogtreecommitdiff
path: root/script/core/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r--script/core/diagnostics/assign-type-mismatch.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/script/core/diagnostics/assign-type-mismatch.lua b/script/core/diagnostics/assign-type-mismatch.lua
index 37e18d09..30d0f97c 100644
--- a/script/core/diagnostics/assign-type-mismatch.lua
+++ b/script/core/diagnostics/assign-type-mismatch.lua
@@ -37,8 +37,18 @@ return function (uri, callback)
return
end
end
- local varNode = vm.compileNode(source)
local valueNode = vm.compileNode(value)
+ if source.type == 'setindex'
+ and vm.isSubType(uri, valueNode, 'nil') then
+ -- boolean[1] = nil
+ local tnode = vm.compileNode(source.node)
+ for n in tnode:eachObject() do
+ if n.type == 'doc.type.array' then
+ return
+ end
+ end
+ end
+ local varNode = vm.compileNode(source)
if vm.canCastType(uri, varNode, valueNode) then
return
end