Commit 43a3dbea authored by Robert Bradshaw's avatar Robert Bradshaw

Fix indexing type inference.

parent 342eb45a
...@@ -2033,7 +2033,7 @@ class IndexNode(ExprNode): ...@@ -2033,7 +2033,7 @@ class IndexNode(ExprNode):
return None return None
def type_dependencies(self, env): def type_dependencies(self, env):
return self.base.type_dependencies(env) return self.base.type_dependencies(env) + self.index.type_dependencies(env)
def infer_type(self, env): def infer_type(self, env):
base_type = self.base.infer_type(env) base_type = self.base.infer_type(env)
......
...@@ -479,3 +479,10 @@ def large_literals(): ...@@ -479,3 +479,10 @@ def large_literals():
c, d = 10, 100000000000000000000000000000000 c, d = 10, 100000000000000000000000000000000
assert typeof(c) == "long", typeof(c) assert typeof(c) == "long", typeof(c)
assert typeof(d) == "Python object", typeof(d) assert typeof(d) == "Python object", typeof(d)
# Regression test for trac #638.
def bar(foo):
qux = foo
quux = foo[qux.baz]
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