-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add overload for unary !
operator to call std::ops::Not
#5000
Comments
@asterite This could also be a good issue to take a look at once you have bandwidth. We've got operator overloads implemented for infix operators but not unary operators. We'd only need to implement this in the elaborator so changes to this file would be sufficient afaik (you can also see the infix implementation in there). |
I mention the elaborator as the legacy type-checking pass also implements trait dispatch and without re-implementing it there you may encounter some test case failures on here and we don't need to worry about fixing those. |
# Description ## Problem Resolves #5000 ## Summary Allows `impl Not` and `impl Neg` to be picked up at runtime. Note that this doesn't work yet at comptime: I'd prefer to do it in a separate PR (mainly to keep PR smaller, but also because I'm not sure how to test it). ## Additional Context None. ## Documentation Is documentation needed for this? Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: jfecher <[email protected]>
After #4999 we'll have a negation trait, we should allow calling this through an operator overload similar to how we do for arithmetic operations.
The text was updated successfully, but these errors were encountered: