diff options
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r-- | script/core/diagnostics/assign-type-mismatch.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/script/core/diagnostics/assign-type-mismatch.lua b/script/core/diagnostics/assign-type-mismatch.lua index b7d11226..ae4b3512 100644 --- a/script/core/diagnostics/assign-type-mismatch.lua +++ b/script/core/diagnostics/assign-type-mismatch.lua @@ -38,13 +38,14 @@ return function (uri, callback) end end local valueNode = vm.compileNode(value) - if source.type == 'setindex' - or source.type == 'setfield' - or source.type == 'tablefield' - or source.type == 'tableindex' then - if valueNode:hasName 'nil' then - valueNode = valueNode:copy():removeOptional() - if valueNode:isEmpty() then + 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' + or n.type == 'doc.type.table' + or n.type == 'table' then return end end |