summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2022-03-11 02:54:36 +0800
committersumneko <sumneko@hotmail.com>2022-03-11 02:54:36 +0800
commitbb02090e9f63355cda301a66571da9d2cd141334 (patch)
tree0baa80f28f442bee7e474c69e3c063f3dec276f6 /test
parentc979f901d19440c6f2cdc899ea38e7c9dc204405 (diff)
downloadlua-language-server-bb02090e9f63355cda301a66571da9d2cd141334.zip
update
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 188ca06b..7721e776 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -656,6 +656,35 @@ local t
local <?k?>, v = f2(t)
]]
+TEST 'fun(a: <V>):integer, <V>' [[
+---@generic K, V
+---@param a K
+---@return fun(a: V):K, V
+local function f(a) end
+
+local <?f2?> = f(1)
+]]
+
+TEST 'integer' [[
+---@generic K, V
+---@param a K
+---@return fun(a: V):K, V
+local function f(a) end
+
+local f2 = f(1)
+local <?i?>, v = f2(true)
+]]
+
+TEST 'boolean' [[
+---@generic K, V
+---@param a K
+---@return fun(a: V):K, V
+local function f(a) end
+
+local f2 = f(1)
+local i, <?v?> = f2(true)
+]]
+
TEST 'string' [[
---@class string