Allow flattened types for inheriting templates

This commit is contained in:
Dirkjan Ochtman 2018-06-22 16:20:39 +02:00
parent 0889f86142
commit 3219ed51e4

View File

@ -57,9 +57,7 @@ impl<'a> Generator<'a> {
// Takes a Context and generates the relevant implementations.
fn build(mut self, ctx: &'a Context) -> String {
let heritage = if !ctx.blocks.is_empty() {
if ctx.extends.is_some() && self.input.parent.is_none() {
panic!("expected field '_parent' in extending template struct");
} else if let Some(parent) = self.input.parent {
if let Some(parent) = self.input.parent {
self.deref_to_parent(parent);
}
let heritage = Heritage::new(ctx, self.contexts);