summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 4a60766b..33521a0d 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3974,3 +3974,29 @@ if x == 0.1 then
print(<?x?>)
end
]]
+
+TEST 'vec3' [[
+---@class mat4
+---@operator mul(vec3): vec3 -- matrix * vector
+---@operator mul(number): mat4 -- matrix * constant
+
+---@class vec3: number
+
+---@type mat4, vec3
+local m, v
+
+local <?r?> = m * v
+]]
+
+TEST 'mat4' [[
+---@class mat4
+---@operator mul(number): mat4 -- matrix * constant
+---@operator mul(vec3): vec3 -- matrix * vector
+
+---@class vec3: number
+
+---@type mat4, vec3
+local m, v
+
+local <?r?> = m * v
+]]