summaryrefslogtreecommitdiff
path: root/test-beta/crossfile/definition.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-15 16:03:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-15 16:03:05 +0800
commit0177c2914c223fb6b335bfdccac1f146c2f80a60 (patch)
treeb300422746c7742de358fb0e9aed05dd6bd6e2af /test-beta/crossfile/definition.lua
parent7970d6ca48f3509c7cfe29a8b81ae7777d6f2556 (diff)
downloadlua-language-server-0177c2914c223fb6b335bfdccac1f146c2f80a60.zip
支持 return setmetatable
Diffstat (limited to 'test-beta/crossfile/definition.lua')
-rw-r--r--test-beta/crossfile/definition.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/test-beta/crossfile/definition.lua b/test-beta/crossfile/definition.lua
index fbeda828..c5601a1f 100644
--- a/test-beta/crossfile/definition.lua
+++ b/test-beta/crossfile/definition.lua
@@ -521,6 +521,31 @@ TEST {
}
}
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
+ local mt = {}
+ mt.__index = mt
+
+ function mt:<!add!>(a, b)
+ end
+
+ return function ()
+ return setmetatable({}, mt)
+ end
+ ]],
+ },
+ {
+ path = 'b.lua',
+ content = [[
+ local m = require 'a'
+ local obj = m()
+ obj:<?add?>()
+ ]]
+ },
+}
+
--TEST {
-- {
-- path = 'a.lua',