summaryrefslogtreecommitdiff
path: root/test/definition
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-11 21:08:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-11 21:08:12 +0800
commit896a1affdeed8304688611674df88140a5cc180e (patch)
treeb9336e9c8d4ea52cf4b6f1aa54d341e1edad305f /test/definition
parente1912470260bac17e7efc565cb59719beb810d01 (diff)
downloadlua-language-server-896a1affdeed8304688611674df88140a5cc180e.zip
infer definitions and types across chain exp
resolve #1561
Diffstat (limited to 'test/definition')
-rw-r--r--test/definition/luadoc.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index 2da10f93..c14e1242 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -932,4 +932,28 @@ local <!b!>
b.<!<?__index?>!> = b
]]
+TEST [[
+---@class myClass
+local myClass = { nested = {} }
+
+function myClass.nested.<!fn!>() end
+
+---@type myClass
+local class
+
+class.nested.<?fn?>()
+]]
+
+TEST [[
+---@class myClass
+local myClass = { has = { nested = {} } }
+
+function myClass.has.nested.<!fn!>() end
+
+---@type myClass
+local class
+
+class.has.nested.<?fn?>()
+]]
+
config.set(nil, 'Lua.type.castNumberToInteger', true)