From fbb038b568fffe8ddbf6946cd0f7d49a624b496a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 2 Nov 2021 20:54:24 +0800 Subject: async doc.type.function --- test/diagnostics/init.lua | 19 +++++++++++++++++++ test/hover/init.lua | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'test') diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index 55adda36..a46a6dd7 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -1369,3 +1369,22 @@ function F() coroutine.yield() end ]] + +TEST [[ +---@type async fun() +local f + +function F() + () +end +]] + +TEST [[ +---@type async fun() +local f + +---@async +function F() + f() +end +]] diff --git a/test/hover/init.lua b/test/hover/init.lua index 404adb44..d2a6e084 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1732,3 +1732,19 @@ local function () end [[ async function f() ]] + +TEST [[ +---@type function +local +]] +[[ +local f: function +]] + +TEST [[ +---@type async fun() +local +]] +[[ +local f: async fun() +]] -- cgit v1.2.3