diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-18 23:07:41 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-18 23:07:41 +0800 |
commit | a92a8003600dc2a0dc867c31bd817320cf6f7c56 (patch) | |
tree | dce16f39f9fabb3c7aa59a20c975098a09eede82 /script/vm/type.lua | |
parent | 38ad313a97e4c191dfefe5831ffb373242f36fa2 (diff) | |
download | lua-language-server-a92a8003600dc2a0dc867c31bd817320cf6f7c56.zip |
fix #1346
Diffstat (limited to 'script/vm/type.lua')
-rw-r--r-- | script/vm/type.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/script/vm/type.lua b/script/vm/type.lua index 5d42de6c..6f2d6f35 100644 --- a/script/vm/type.lua +++ b/script/vm/type.lua @@ -105,13 +105,16 @@ function vm.isSubType(uri, child, parent, mark) child = global elseif child.type == 'vm.node' then if config.get(uri, 'Lua.type.weakUnionCheck') then + local hasKnownType for n in child:eachObject() do - if getNodeName(n) - and vm.isSubType(uri, n, parent, mark) then - return true + if getNodeName(n) then + hasKnownType = true + if vm.isSubType(uri, n, parent, mark) then + return true + end end end - return false + return not hasKnownType else local weakNil = config.get(uri, 'Lua.type.weakNilCheck') for n in child:eachObject() do |