Template extension inference