From af024872678d83e51a110ed96a8b6967acfecdc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 9 Nov 2020 21:51:33 +0800 Subject: =?UTF-8?q?=E5=8F=AA=E6=9C=89=20doc.class=20=E4=B8=8E=20doc.type?= =?UTF-8?q?=20=E6=89=8D=E4=BC=9A=E8=B7=B3=E8=BF=87=E6=8E=A8=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/parser/guide.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'script-beta/parser') diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index c9f4eb48..88a09481 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -1401,6 +1401,7 @@ function m.checkSameSimpleByBindDocs(status, obj, start, queue, mode) if status.cache.searchingBindedDoc then return end + local skipInfer = false local results = {} for _, doc in ipairs(obj.bindDocs) do if doc.type == 'doc.class' then @@ -1447,6 +1448,7 @@ function m.checkSameSimpleByBindDocs(status, obj, start, queue, mode) m.searchRefs(newStatus, ref, mode) end end + skipInfer = true end if res.type == 'doc.type.function' then queue[#queue+1] = { @@ -1468,7 +1470,7 @@ function m.checkSameSimpleByBindDocs(status, obj, start, queue, mode) force = true, } end - return true + return skipInfer end function m.checkSameSimpleInArg1OfSetMetaTable(status, obj, start, queue) @@ -1775,9 +1777,6 @@ function m.searchSameFieldsInValue(status, ref, start, queue, mode) } -- 检查形如 a = f() 的分支情况 m.checkSameSimpleInCall(status, value, start, queue, mode) - - -- 检查自己是字面量表的情况 - --m.checkSameSimpleInValueOfTable(status, value, start, queue) end function m.checkSameSimpleAsTableField(status, ref, start, queue) @@ -1994,8 +1993,8 @@ function m.checkSameSimple(status, simple, data, mode, queue) cmode = 'ref' end -- 检查 doc - local hasDoc = m.checkSameSimpleByBindDocs(status, ref, i, queue, cmode) - if not hasDoc then + local skipInfer = m.checkSameSimpleByBindDocs(status, ref, i, queue, cmode) + if not skipInfer then -- 穿透 self:func 与 mt:func m.searchSameFieldsCrossMethod(status, ref, i, queue) -- 穿透赋值 -- cgit v1.2.3