summaryrefslogtreecommitdiff
path: root/script
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 /script
parentf0d3ef728726217a791764bdfc2d2375e1217afb (diff)
downloadlua-language-server-7f35d4640b4a7338fdd34fb1c3509c3c671fa0ec.zip
contravariance is allowed at the class declaration
Diffstat (limited to 'script')
-rw-r--r--script/core/diagnostics/assign-type-mismatch.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/script/core/diagnostics/assign-type-mismatch.lua b/script/core/diagnostics/assign-type-mismatch.lua
index 0cccc7ee..2d5c3f98 100644
--- a/script/core/diagnostics/assign-type-mismatch.lua
+++ b/script/core/diagnostics/assign-type-mismatch.lua
@@ -99,12 +99,7 @@ return function (uri, callback)
end
-- local Cat = setmetatable({}, {__index = Animal}) 允许逆变
- if value.type == 'select'
- and value.sindex == 1
- and value.vararg
- and value.vararg.type == 'call'
- and value.vararg.node.special == 'setmetatable'
- and hasMarkClass(source) then
+ if hasMarkClass(source) then
if vm.canCastType(uri, valueNode:copy():remove 'table', varNode) then
return
end