Issue 9977 - Function local templates should be allowed

http://d.puremagic.com/issues/show_bug.cgi?id=9977