diff options
author | uhziel <uhziel@gmail.com> | 2020-12-10 11:30:40 +0800 |
---|---|---|
committer | uhziel <uhziel@gmail.com> | 2020-12-10 11:30:40 +0800 |
commit | 40485201209974f79f8ecfc8ffc12352c41b56fc (patch) | |
tree | c469401bc4a013091d3ad3244611ebbc0945b3b3 /test/diagnostics/init.lua | |
parent | ee244313a7adaedf40fb83d79595f42b5c054a9c (diff) | |
download | lua-language-server-40485201209974f79f8ecfc8ffc12352c41b56fc.zip |
添加对继承的测试
Diffstat (limited to 'test/diagnostics/init.lua')
-rw-r--r-- | test/diagnostics/init.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index 9c934bd5..55ee8940 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -834,6 +834,10 @@ end function mt:method1() return 1 end function mt.method2() return 2 end +---@class Bar: Foo +---@field field4 integer +local mt2 = {} + ---@type Foo local v print(v.field1 + 1) @@ -843,6 +847,16 @@ print(v:method1()) print(v.method2()) print(<!v:method3!>()) +---@type Bar +local v2 +print(v2.field1 + 1) +print(v2.field2 + 1) +print(<!v2.field3!> + 1) +print(v2.field4 + 1) +print(v2:method1()) +print(v2.method2()) +print(<!v2:method3!>()) + local v1 = {} print(v1.abc) ]] |