Closed olanod closed 4 years ago
is this possibly related to https://github.com/riker-rs/riker/pull/100 ?
@igalic No, this is about the generic part of the user-struct and not about the Receive
trait. The derive macro ignores the generic type parameters.
In procedural macros the type being "expanded" is represented by proc_macros::Ident
and that doesn't seem to capture the generic component - or at least I had trouble doing so when I wrote the macro. Documentation isn't great, but once once you get the DSL it is fairly straight forward.
https://github.com/riker-rs/riker/blob/master/src/actor/channel.rs is an example of implementing the trait manually without the macro, if you need to get your application working urgently.
I already tried to fix this. There is an example inside the sync documentation: https://docs.rs/syn/1.0.33/syn/struct.Generics.html#method.split_for_impl
Sadly just following that example still won’t compile because a type parameter is missing somewhere. I’ll try again today.
Hi! I have an Actor that is generic over a type and when using the macro
#[actor(SomeMsg)]
the compiler complains withwrong number of type arguments: expected 1, found 0 expected 1 type argument
.Doesn't seem like a big issue to fix but I haven't worked with procedural macros, I might try later but if anyone knows how to feel free to jump in :)