Commit fc4a97a0 authored by Stefan Behnel's avatar Stefan Behnel

drop 'vile hack' by restricting state changes of AttributeNode during...

drop 'vile hack' by restricting state changes of AttributeNode during infer_type() to what analyse_types() does
parent 1fa5ba65
......@@ -2249,9 +2249,6 @@ class NextNode(AtomicExprNode):
fake_index_node = IndexNode(self.pos,
base=self.iterator.sequence,
index=IntNode(self.pos, value='0'))
# TODO(vile hack): infer_type should be side-effect free
if isinstance(self.iterator.sequence, SimpleCallNode):
return py_object_type
return fake_index_node.infer_type(env)
def analyse_types(self, env):
......@@ -4453,7 +4450,7 @@ class AttributeNode(ExprNode):
# special case: C-API replacements for C methods of
# builtin types cannot be inferred as C functions as
# that would prevent their use as bound methods
self.type = py_object_type
return py_object_type
return self.type
def analyse_target_declaration(self, env):
......
......@@ -18,7 +18,6 @@ temp_sideeffects_T654
class_scope_T671
slice2_T636
builtin_subtype_methods_T653
dict_values_in_expression
builtin_float
inherited_final_method
......
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