summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-12 16:40:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-12 16:40:49 +0800
commit7f35d4640b4a7338fdd34fb1c3509c3c671fa0ec (patch)
tree4609d6e0199991091ae4c2d87881b3796dab740e /test
parentf0d3ef728726217a791764bdfc2d2375e1217afb (diff)
downloadlua-language-server-7f35d4640b4a7338fdd34fb1c3509c3c671fa0ec.zip
contravariance is allowed at the class declaration
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/type-check.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua
index 36de70e0..b8951307 100644
--- a/test/diagnostics/type-check.lua
+++ b/test/diagnostics/type-check.lua
@@ -635,13 +635,21 @@ TEST [[
---@class A
local a = {}
----@class B: A
+---@class B
local <!b!> = a
]]
TEST [[
---@class A
local a = {}
+
+---@class B: A
+local b = a
+]]
+
+TEST [[
+---@class A
+local a = {}
a.__index = a
---@class B: A