typeshare
typeshare copied to clipboard
Generics exist in generated code even if they are unused
If a type doesn't serialize any generic fields, we shouldn't be applying a generic parameter to the generated code. However, this is currently not the case.
Ideally, these definitions should not generate data classes/type aliases with generics.
#[typeshare]
struct Phantom<A> {
some_value: u32,
_phantom_data: PhantomData<A>
}
#[typeshare]
struct UnusedGeneric<A, B, C> {}
Is there a possibility that the destination type should have these generics? I'm thinking about a hypothetical case like Uuid<Account>
vs Uuid<Collection>
, where those types would want to have equivalent distinct generics on the output side.