Closed mendess closed 8 months ago
Would it also be possible to change the generic parameter name T
for the blanket implementation to something less likely to cause a naming conflict? T
is commonly used as a name for a generic type, but when using this macro it will not compile unless the parameter in the trait is renamed. Similarly, for generic types used at the function level.
For example, even with this PR merged, the following does not compile:
#[trait_variant::make(Trait: Send)]
trait LocalTrait<T> {
async fn trait_fn() -> T;
}
and
#[trait_variant::make(Trait: Send)]
trait LocalTrait {
async fn trait_fn<T>() -> T;
}
Perhaps change it to TraitVariantBlanketType
or something?
@andrewtoth that's a good idea, done.
Thanks! I see PR #20 will have a conflict because of this now though :(.
Thanks! I see PR #20 will have a conflict because of this now though :(.
That's okay. I'll fix the conflicts! I've already done so I could test both PRs in a real codebase
Add support of traits that have generic parameters. Resolving #16.
(Also I tried to sign the Google CLA as described in the CONTRIBUTING.md file, but I kept getting a
A server error occurred, please try your request again.
error)