diff options
-rw-r--r-- | script/parser/guide.lua | 1 | ||||
-rw-r--r-- | test/type_inference/init.lua | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 28a37dac..d47d0034 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -256,6 +256,7 @@ function m.isLiteral(obj) or tp == 'doc.type.integer' or tp == 'doc.type.boolean' or tp == 'doc.type.code' + or tp == 'doc.type.array' end --- 获取字面量 diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index c402cb8d..522c48f2 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2657,3 +2657,13 @@ end local <?x?> = f() ]] + +TEST 'integer[]' [[ +---@type integer[] +local x +if not x then + return +end + +print(<?x?>) +]] |