/// Test syntax error in the interpolation template mod library; use despatma_abstract_factory::{abstract_factory, interpolate_traits}; use library::elements::{Button, Element, Window}; struct GnomeButton {} impl Element for GnomeButton { fn create() -> Self { GnomeButton {} } } impl Button for GnomeButton { fn click(&self) {} } // Factory for a single element pub trait Factory { fn create(&self) -> Box; } // Abstract Factory for multiple elements #[abstract_factory(Factory, dyn Button, Window)] pub trait AbstractGuiFactory {} // Concrete factory implementing the abstract factory struct GnomeFactory {} impl AbstractGuiFactory for GnomeFactory {} // Implement the factory trait for each type #[interpolate_traits(Button => GnomeButton)] impl Factory for GnomeFactory { fn create(&self) -> Box { Box::new(CONCRETE::new()) } } #[interpolate_traits(Window => Window)] impl Factory for GnomeFactory { fn create(&self) -> Box { Box::new(CONCRETE::create()); } } fn main() {}