summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-02-10 18:08:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-02-10 18:08:19 +0800
commit3154cef2313eb5ec7e067571f7ff6438b8a26ced (patch)
tree468bc1be0b3f693449e7906267989e80a5db8997 /test
parent4943e05d47dd2b5a572b30a2ddbb7b886fe2b05b (diff)
downloadlua-language-server-3154cef2313eb5ec7e067571f7ff6438b8a26ced.zip
fix #1887
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 4e3c9d5b..87e6c490 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -4219,3 +4219,17 @@ end
function Y()
end
]]
+
+TEST 'A_Class' [[
+---@class A_Class
+local A = { x = 5 }
+
+function A:func()
+ for i = 1, <?self?>.x do
+ print(i)
+ end
+
+ self.y = 3
+ self.y = self.y + 3
+end
+]]