summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-07 02:58:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-07 02:58:03 +0800
commit84441873f6b0e4a75ee9b9d96d88c5609c7a48dc (patch)
tree6f390e1e74cca7a0b0bb70a7680519af0fa43c04 /test
parente9975c2081dfe2f42392a7612b2a3862e513e45e (diff)
downloadlua-language-server-84441873f6b0e4a75ee9b9d96d88c5609c7a48dc.zip
update
Diffstat (limited to 'test')
-rw-r--r--test/crossfile/hover.lua18
-rw-r--r--test/type_inference/init.lua9
2 files changed, 18 insertions, 9 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index 10124eb9..b0cc8c7d 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -825,7 +825,7 @@ local <?food?>
},
hover = [[
```lua
-local food: any
+local food: unknown
```
---
@@ -976,17 +976,17 @@ end
},
hover = [[
```lua
-function f(p: a|b)
+function f(p: "a"|"b")
```
---
```lua
-p: T
- | a -- comment 1
- -- comment 2
- | b -- comment 3
- -- comment 4
+p:
+ | "a" -- comment 1
+ -- comment 2
+ | "b" -- comment 3
+ -- comment 4
```]]}
--TEST {{ path = 'a.lua', content = '', }, {
@@ -1044,13 +1044,13 @@ end
for _, x in ipairs({} and {}) do
- print(<?x?>) -- `x` is infered as `string`
+ print(<?x?>) -- `x` is infered as `string` (fixed bug)
end
]],
},
hover = [[
```lua
-local x: any
+local x: unknown
```]]
}
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index a6311e6e..5ac5bece 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1381,3 +1381,12 @@ local t
t.<?a?>
]]
+
+TEST 'integer' [[
+---@class A
+---@field x integer
+
+---@type A
+local t
+t.<?x?>
+]]