partial support for variable extends in templates