Test generics and other things

This commit is contained in:
Werner
2022-05-22 13:41:48 -03:00
parent acb22d7ce6
commit ced258e5c5
16 changed files with 283 additions and 32 deletions

View File

@ -10,9 +10,12 @@ use syn::{parse_macro_input, DeriveInput, ItemFn};
pub fn reflect(input: TokenStream) -> TokenStream {
let class = parse_macro_input!(input as DeriveInput);
let name = &class.ident;
let generics = &class.generics;
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
let expanded = quote! {
unsafe impl Reflect for #name {
unsafe impl #impl_generics Reflect for #name #ty_generics #where_clause {
fn TypeName(&self) -> &'static str {
std::any::type_name::<Self>()
}