Angle bracket annotated types to support generics (#1919)

Fixes #1873. Types should be enclosed in angular brackets to avoid ambiquity and to correctly resolve associated functions.
This commit is contained in:
Yoh Deadfall 2021-04-15 00:16:40 +00:00
parent 490a957542
commit 22314923d9

View file

@ -118,13 +118,13 @@ pub fn derive_bundle(input: TokenStream) -> TokenStream {
{
if *is_bundle {
field_type_infos.push(quote! {
type_info.extend(#field_type::type_info());
type_info.extend(<#field_type as #ecs_path::bundle::Bundle>::type_info());
});
field_get_components.push(quote! {
self.#field.get_components(&mut func);
});
field_from_components.push(quote! {
#field: #field_type::from_components(&mut func),
#field: <#field_type as #ecs_path::bundle::Bundle>::from_components(&mut func),
});
} else {
field_type_infos.push(quote! {