-
Notifications
You must be signed in to change notification settings - Fork 57
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
Feature request: support derive
for traits
#342
Comments
As an aside... now I'm remembering that I got a weird error message about |
Does pub(open) trait Object : Show {
// everything other than to_string / output
} Work for you?
Maybe you are using it as trait object? |
Sure, sounds good. So multiple derives would be
I didn't think so, but will have to try again to test it out. |
Again, feel free to close if this is already the case. |
It's
This could be a bug if you are using a |
Transferring to moonbit-docs since it's a missing topic in document. |
Context: https://github.com/gmlewis/moonbit-ray-tracer
In this repo, I was forced to write:
instead of (preferred):
in order to support
inspect!
in black-box unit tests, but the compiler doesn't allow it.(Also, I wanted to add
op_equal
to supportassert_eq!
but couldn't get it to work with trait objects... but that's probably a different issue that is unrelated to this one.)It might be nice to be able to derive any methods for traits, like
Show
,Eq
,FromJson
,ToJson
, etc.The text was updated successfully, but these errors were encountered: