summaryrefslogtreecommitdiff
path: root/test/diagnostics/type-check.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-23 01:20:51 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-23 01:20:51 +0800
commit01d5bb715d5d75d9ed16bd375f83e93cba0db8e9 (patch)
tree318dd67ba66b7c73afa2ba0fc071321ae2bbcbc5 /test/diagnostics/type-check.lua
parent137d40a9fcf7690820914a91c492ef4881ddc250 (diff)
downloadlua-language-server-01d5bb715d5d75d9ed16bd375f83e93cba0db8e9.zip
search definitions by 1st arg of `setmetatable`
resolve #1575
Diffstat (limited to 'test/diagnostics/type-check.lua')
-rw-r--r--test/diagnostics/type-check.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua
index bdba855b..a4ee1d65 100644
--- a/test/diagnostics/type-check.lua
+++ b/test/diagnostics/type-check.lua
@@ -841,6 +841,20 @@ TEST [[
local <!test!> = 4
]]
+TEST [[
+---@class MyClass
+local MyClass = {}
+
+function MyClass:new()
+ ---@class MyClass
+ local myObject = setmetatable({
+ initialField = true
+ }, self)
+
+ print(myObject.initialField)
+end
+]]
+
config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
config.remove(nil, 'Lua.diagnostics.disable', 'unused-function')
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')