From 63211177f8f3ad2a50dca3ab2ccaae737486813c 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 17:04:20 +0800 Subject: support `@type` for `return` #2144 --- test/type_inference/init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/type_inference') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 9f5c8493..aba6b0b4 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -4314,6 +4314,7 @@ repeat until ]] +-- #2144 TEST 'A' [=[ local function f() return {} --[[@as A]] @@ -4321,3 +4322,13 @@ end local = f() ]=] + +TEST 'A' [=[ +local function f() + ---@type A + return {} +end + +local = f() +]=] +-- -- cgit v1.2.3