summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/definition/luadoc.lua24
-rw-r--r--test/type_inference/init.lua12
2 files changed, 36 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)
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 6f74e1af..f0948b49 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3791,3 +3791,15 @@ TEST 'A|B' [[
---@type A|B
local <?t?>
]]
+
+TEST 'function' [[
+---@class myClass
+local myClass = { has = { nested = {} } }
+
+function myClass.has.nested.fn() end
+
+---@type myClass
+local class
+
+class.has.nested.<?fn?>()
+]]