From 83f2b383bb2d1bc2defca63b6dd34d7f5875eef0 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, 23 May 2022 17:22:58 +0800 Subject: fix can not union `unknown` with other types --- script/vm/infer.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'script/vm') diff --git a/script/vm/infer.lua b/script/vm/infer.lua index fabc9828..dba46ffc 100644 --- a/script/vm/infer.lua +++ b/script/vm/infer.lua @@ -76,7 +76,9 @@ local viewNodeSwitch = util.switch() : case 'global' : call(function (source, infer) if source.cate == 'type' then - infer._hasClass = true + if source.name ~= 'unknown' then + infer._hasClass = true + end if source.name == 'number' then infer._hasNumber = true end -- cgit v1.2.3