-
Notifications
You must be signed in to change notification settings - Fork 1
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
Can we have auto [Expose] so 3rd party classes can be used as traits #10
Comments
Ok, that was a pain in the ass. Apparently EVERYTHING is a method when you get down to the I don't know if I should praise or damn you for forcing me to learn so much more about Roslyn. I posted version 0.10.0 up on NuGet. Let me know how it works. |
Thank your for you fast implementation! Hope i can stay on the praise side of things :) I tested boldly with using Tortuga.Shipwright;
namespace Traits.Examples;
[UseTrait(typeof(MemoryStream), AutoExpose = Expose.All)]
public partial class StreamComposition
{
public StreamComposition()
{
}
} And have found two issues:
Both issues lead to a compilation error in generated class. However, for my current needs I am more happy with what I got. THX again 👍 |
That makes sense because we assume the person putting on the So I think we can fix this by setting it to only auto-expose |
P.S. Feedback helps a lot to keep me motivated. |
That makes sense to me. And since I am interested in composition I am not supposed to fiddle around with anything that is protected. At least for that use-case. One way out of the "Dispose()-Issue" could be something like |
I just dropped 0.11.0 with support for MemoryStream's output parameters. |
Yea, that's something that will be needed eventually. But it's going to require more brainpower than I have to get the API right. |
Can confirm that |
Just found nice generator.
I was wondering if the
[Expose]
attribute is really necessary. It adds clarity when owning the trait class but on the other hand we can not use external classes.Maybe opt-out via enum e.g.:
[UseTrait(typeof(ABase), AutoExpose=Expose.PropertiesAndMethods)]
So far works like a charm. THX!
The text was updated successfully, but these errors were encountered: