summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/type-check.lua17
-rw-r--r--test/type_inference/init.lua7
2 files changed, 24 insertions, 0 deletions
diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua
index 711211e8..34f7a492 100644
--- a/test/diagnostics/type-check.lua
+++ b/test/diagnostics/type-check.lua
@@ -479,5 +479,22 @@ n = nb
]]
config.set(nil, 'Lua.type.weakUnionCheck', false)
+TEST [[
+---@class Option: string
+
+---@param x Option
+local function f(x) end
+
+---@type Option
+local x = 'aaa'
+
+f(x)
+]]
+
+TEST [[
+---@type number
+local <!x!> = 'aaa'
+]]
+
config.remove(nil, 'Lua.diagnostics.disable', 'unused-local')
config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global')
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 7b4185d7..4b745c0d 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3142,3 +3142,10 @@ for _ in _ do
end
print(<?s?>)
]]
+
+TEST 'A' [[
+---@class A: string
+
+---@type A
+local <?s?> = ''
+]]