diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-18 01:03:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-18 01:03:25 +0800 |
commit | 6df9d8376bc5339a8c4218cc261dc76d7ac8e7ad (patch) | |
tree | a6e13efaf733f6b3ef618ece150aa1fb3579f456 /script/core/diagnostics | |
parent | 7b35e39b5eae7c3445cd9ec4d16637185bc26b93 (diff) | |
download | lua-language-server-6df9d8376bc5339a8c4218cc261dc76d7ac8e7ad.zip |
update
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r-- | script/core/diagnostics/assign-type-mismatch.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/script/core/diagnostics/assign-type-mismatch.lua b/script/core/diagnostics/assign-type-mismatch.lua index 9a101be1..d301faed 100644 --- a/script/core/diagnostics/assign-type-mismatch.lua +++ b/script/core/diagnostics/assign-type-mismatch.lua @@ -5,6 +5,7 @@ local vm = require 'vm' local await = require 'await' local checkTypes = { + 'setlocal', 'setglobal', 'setfield', 'setindex', @@ -27,6 +28,12 @@ return function (uri, callback) return end await.delay() + if source.type == 'setlocal' then + local locNode = vm.compileNode(source.node) + if not locNode:getData 'hasDefined' then + return + end + end local varNode = vm.compileNode(source) local valueNode = vm.compileNode(value) if vm.getInfer(varNode):hasUnknown(uri) then |