From 3511bfd1b986bfce7f9993ddf3e4a9e3818b83ec Mon Sep 17 00:00:00 2001
From: d-enk <denis.l@irecommend.ru>
Date: Thu, 23 Nov 2023 12:55:42 +0300
Subject: [PATCH] fix: `doc.type.function` resolve only existing arg.extends

---
 script/vm/sign.lua | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/script/vm/sign.lua b/script/vm/sign.lua
index 3cd6bc5d7..38cb2242b 100644
--- a/script/vm/sign.lua
+++ b/script/vm/sign.lua
@@ -142,13 +142,15 @@ function mt:resolve(uri, args)
         end
         if object.type == 'doc.type.function' then
             for i, arg in ipairs(object.args) do
-                for n in node:eachObject() do
-                    if n.type == 'function'
-                    or n.type == 'doc.type.function' then
-                        ---@cast n parser.object
-                        local farg = n.args and n.args[i]
-                        if farg then
-                            resolve(arg.extends, vm.compileNode(farg))
+                if arg.extends then
+                    for n in node:eachObject() do
+                        if n.type == 'function'
+                        or n.type == 'doc.type.function' then
+                            ---@cast n parser.object
+                            local farg = n.args and n.args[i]
+                            if farg then
+                                resolve(arg.extends, vm.compileNode(farg))
+                            end
                         end
                     end
                 end
-- 
GitLab