Commit e31d6a86 authored by Craig Citro's avatar Craig Citro

Fix bug in type analysis for ComprehensionNodes.

parent 3f74e41f
......@@ -3988,6 +3988,9 @@ class ComprehensionNode(ScopedExprNode):
if not self.has_local_scope:
self.loop.analyse_expressions(env)
def analyse_expressions(self, env):
self.analyse_types(env)
def analyse_scoped_expressions(self, env):
if self.has_local_scope:
self.loop.analyse_expressions(env)
......
def foo():
"""
>>> foo()
[[], [-1], [-1, 0], [-1, 0, 1]]
"""
result = [[a-1 for a in range(b)] for b in range(4)]
return result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment