summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-22 21:03:50 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-22 21:03:50 +0800
commit30f1cea83c4d88775932dc4bc8c12b9c74ecfb19 (patch)
tree5f0e466931573e5d9e4da80f25b8355697de8cd4 /test/type_inference
parentcdb6c06ca2983f1caf1a0964997c8c44ea784b27 (diff)
downloadlua-language-server-30f1cea83c4d88775932dc4bc8c12b9c74ecfb19.zip
display optional field in table
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 7a4fb754..e7560a12 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1795,3 +1795,18 @@ TEST 'integer' [[
local x = 1
x = <?x?>
]]
+
+TEST 'integer?' [[
+---@class A
+---@field x? integer
+local t
+
+t.<?x?>
+]]
+
+TEST 'integer?' [[
+---@type { x?: integer }
+local t
+
+t.<?x?>
+]]