summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua40
1 files changed, 34 insertions, 6 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 5d052f7f..d3ff258c 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -96,19 +96,35 @@ TEST 'boolean' [[
<?x?> = not y
]]
-TEST 'integer' [[
+TEST 'any' [[
<?x?> = #y
]]
-TEST 'number' [[
-<?x?> = - y
+TEST 'integer' [[
+<?x?> = #'aaaa'
]]
TEST 'integer' [[
+<?x?> = #{}
+]]
+
+TEST 'any' [[
+<?x?> = - y
+]]
+
+TEST 'number' [[
+<?x?> = - 1.0
+]]
+
+TEST 'any' [[
<?x?> = ~ y
]]
TEST 'integer' [[
+<?x?> = ~ 1
+]]
+
+TEST 'integer' [[
local a = true
local b = 1
<?x?> = a and b
@@ -124,18 +140,30 @@ TEST 'boolean' [[
<?x?> = a == b
]]
-TEST 'integer' [[
+TEST 'any' [[
<?x?> = a << b
]]
-TEST 'string' [[
+TEST 'integer' [[
+<?x?> = 1 << 2
+]]
+
+TEST 'any' [[
<?x?> = a .. b
]]
-TEST 'number' [[
+TEST 'string' [[
+<?x?> = 'a' .. 'b'
+]]
+
+TEST 'any' [[
<?x?> = a + b
]]
+TEST 'number' [[
+<?x?> = 1 + 2.0
+]]
+
TEST 'tablelib' [[
---@class tablelib
table = {}