Skip to content

Conversation

@thoys
Copy link

@thoys thoys commented Jul 7, 2022

This PR adds support for extending the number / integer operators.

For example if you have a Vector3 class that could be multiplied with now this will work

---@class integer
---@operator mul(Vector3): Vector3
---@class number
---@operator mul(Vector3): Vector3
local shouldShowupAsAVector3 = 1.0 * Vector3.New(1,2,3);

@sumneko
Copy link
Collaborator

sumneko commented Jul 7, 2022

First of all, thank you for your PR.
But I don't think this can work, the operator should be a part of Vector3 instead of integer or number, but the current design does not support it as the second operation.
In addition, you need to add unit testing

@sumneko
Copy link
Collaborator

sumneko commented Jul 26, 2022

see #1371

@sumneko sumneko closed this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants