fixed a bug in extension handling

--HG--
branch : trunk
diff --git a/jinja2/compiler.py b/jinja2/compiler.py
index 6518427..7b8366c 100644
--- a/jinja2/compiler.py
+++ b/jinja2/compiler.py
@@ -719,7 +719,8 @@
         # if this extends statement was in the root level we can take
         # advantage of that information and simplify the generated code
         # in the top level from this point onwards
-        self.has_known_extends = True
+        if frame.rootlevel:
+            self.has_known_extends = True
 
         # and now we have one more
         self.extends_so_far += 1