summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-03-29 11:13:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-03-29 11:13:07 +0800
commitf7905e759ec7be0188b7f237eeb531bc111695af (patch)
tree3506acfffc7d10307457629725bec2b09accf81e /test/type_inference
parent265e5f81721c29d4351b5b6bffea612d31354ed4 (diff)
downloadlua-language-server-f7905e759ec7be0188b7f237eeb531bc111695af.zip
#450 fix generic from method call
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index f45e6a9e..08bac1eb 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -606,3 +606,15 @@ function m:f()
return <?self?>
end
]]
+
+TEST 'Cls' [[
+---@class Cls
+local Cls = {}
+
+---@generic T
+---@param self T
+---@return T
+function Cls.new(self) return self end
+
+local <?test?> = Cls:new()
+]]