Closed CJKay closed 2 years ago
Hi folks, I'm having some trouble getting a trait with multiple generic type arguments to delegate. I couldn't find this in either the test or any of the examples, so I'm just wondering whether this is an undocumented limitation.
This works fine:
#[delegatable_trait] pub trait Target<T> {} pub struct SubTarget; impl<T> Target<T> for SubTarget {} #[derive(Delegate)] #[delegate(Target<T>, generics = "T")] pub struct SuperTarget(SubTarget);
This, on the other hand:
#[delegatable_trait] pub trait Target<T, U> {} pub struct SubTarget; impl<T, U> Target<T, U> for SubTarget {} #[derive(Delegate)] #[delegate(Target<T, U>, generics = "T, U")] pub struct SuperTarget(SubTarget);
Throws this error:
error: proc-macro derive panicked --> ... | 1 | #[derive(Delegate)] | ^^^^^^^^ | = help: message: expected `,`
I am seeing a similar issue when I tried to delegate std::ops::Index<usize, Output=T>
std::ops::Index<usize, Output=T>
Hi folks, I'm having some trouble getting a trait with multiple generic type arguments to delegate. I couldn't find this in either the test or any of the examples, so I'm just wondering whether this is an undocumented limitation.
This works fine:
This, on the other hand:
Throws this error: