I'd like to be able to define overloads of an operator, for example a matrix class could provide the following overloads of mul:
---@class mat4
---@operator mul(mat4): mat4 -- matrix mult
---@operator mul(vec3): vec3 -- matrix * vector
---@operator mul(number): mat4 -- matrix * constant
However it seems that local y = matrix * vector; is currently deduced as type mat4 | vec3.
Is there a way to achieve this?
I'd like to be able to define overloads of an operator, for example a matrix class could provide the following overloads of mul:
However it seems that
local y = matrix * vector;is currently deduced as typemat4 | vec3.Is there a way to achieve this?