-
Notifications
You must be signed in to change notification settings - Fork 386
Add support for optional references #868
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
base: master
Are you sure you want to change the base?
Conversation
Side note: cxx is awesome and I can't thank you enough for setting it up. I'm just running into all the rough edges because I'm trying to push it really far. |
Added a simple smoke test, fixed the fallout. Ready for review. |
I'm happy with the state of this, pending review. I hope the semantics match what you want out of cxx, because this patch is very useful for the use case I'm pursuing currently. |
More testing found two edge cases I hadn't handled; handled those now. |
(why can't I unmark the PR as ready for review) So I added a test for I think that fixing that should wait for resolving #682, though, as that will majorly impact the handling of builtin types anyway. |
This closes #865.
This accidentally also allows arbitrarily nesting
Option
andPin
. On emitting code, it's always normalized toOption<Pin<ref>>
. I don't know how to avoid this. You could already arbitrarily nestPin
s (which would be normalized to onePin
), though that seems less problematic than allowing someone to write e.g.Pin<Option<ref>>
and getting outOption<Pin<ref>>
.I don't know how to fix
Pin<Option<ref>>
without also breakingPin<Pin<ref>>
.Pin<Pin<ref>>
is certainly bad practice and misleading, though, so perhaps breaking it is desirable.