From c3c73efb8fbb3e37d0191d3f924283861218a358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 10 Aug 2023 16:23:01 +0800 Subject: enable `as` table #2144 --- changelog.md | 2 +- script/vm/compiler.lua | 3 +++ test/type_inference/init.lua | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 820c4af7..247b10da 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # changelog -## 3.6.26 +## 3.7.0 * `FIX` wrong hover and signature for method with varargs and overloads * `FIX` [#2224] diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index a6b95b7c..a4147d70 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1153,6 +1153,9 @@ local compilerSwitch = util.switch() end) : case 'table' : call(function (source) + if vm.bindAs(source) then + return + end vm.setNode(source, source) if source.parent.type == 'callargs' then diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 8797cfdd..9f5c8493 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -4313,3 +4313,11 @@ local x = 1 repeat until ]] + +TEST 'A' [=[ +local function f() + return {} --[[@as A]] +end + +local = f() +]=] -- cgit v1.2.3