From df0c611e4a0375696d51e1d71cc544d7ee3c4557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 30 Nov 2022 20:47:58 +0800 Subject: fix #1729 --- test/type_inference/init.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/type_inference') 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() 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 = 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 = m * v +]] -- cgit v1.2.3