-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support for modules included in a class #3
Comments
Hello, Been a long time since I took a look at the code. But interesting use-case you have there! The In any case, what you'd have to do then is to modify the Cheers! |
Hi there! Thanks for the quick response. Here is the exact error. It looks like it is already using a Union, but maybe it is defining the wrong method? instantiating 'Cannon:Module#encode(IO::Memory, Avram::Paramable)'
in lib/cannon/src/cannon/serialisation.cr:18: wrong number of arguments for 'Avram::Paramable.to_cannon_io' (given 2, expected 1)
- Cannon::AutoToIo#to_cannon_io(io)
Union(typeof(value)).to_cannon_io(io, value) |
Would say so as well, but I guess that You'd have to modify the |
Thank you for the help. I'm not sure I'll be able to do that, but I'll give it a shot :) |
Let's say I have a module that is included in a class:
And I make an instance var of the module type
The problem is that
Paramable
is a module so you can't define instance methods on it that Cannon expects.Is there a way to do this? And if not, do you have an idea of where I could start? I'd love to try a PR
The text was updated successfully, but these errors were encountered: