Remove broken code

Trait templates can only be constant expression nodes, so fixing the
broken is not actually needed and it can be removed.
This commit is contained in:
Christophe Coevoet
2015-08-13 10:32:03 +02:00
parent 37553291e6
commit e6ae0d0caa
+1 -16
View File
@@ -402,22 +402,7 @@ class Twig_Node_Module extends Twig_Node
->raw(");\n")
;
} else {
$compiler
->write(sprintf('%s = ', $var))
->subcompile($node)
->raw(";\n")
->write(sprintf('if (!%s', $var))
->raw(" instanceof Twig_Template) {\n")
->indent()
->write(sprintf('%s = $this->loadTemplate(%s')
->raw(', ')
->repr($compiler->getFilename())
->raw(', ')
->repr($node->getLine())
->raw(");\n", $var, $var))
->outdent()
->write("}\n")
;
throw new LogicException('Trait templates can only be constant nodes');
}
}
}