Commit 265c1933 authored by Jan Hönig's avatar Jan Hönig
Browse files

Fixing forgotten change to ast.Conditional in typing

parent 820ad582
...@@ -54,16 +54,14 @@ class TypeAdder: ...@@ -54,16 +54,14 @@ class TypeAdder:
if isinstance(obj, (sp.Eq, ast.SympyAssignment, Assignment)): if isinstance(obj, (sp.Eq, ast.SympyAssignment, Assignment)):
return self.process_assignment(obj) return self.process_assignment(obj)
elif isinstance(obj, ast.Conditional): elif isinstance(obj, ast.Conditional):
condition, condition_type = self.figure_out_type(obj.condition_expr)
assert condition_type == BasicType('bool')
true_block = self.visit(obj.true_block)
false_block = None if obj.false_block is None else self.visit( false_block = None if obj.false_block is None else self.visit(
obj.false_block) obj.false_block)
result = ast.Conditional(self.process_expression( return ast.Conditional(condition, true_block=true_block, false_block=false_block)
obj.condition_expr, type_constants=False),
true_block=self.visit(obj.true_block),
false_block=false_block)
return result
elif isinstance(obj, ast.Block): elif isinstance(obj, ast.Block):
result = ast.Block([self.visit(e) for e in obj.args]) return ast.Block([self.visit(e) for e in obj.args])
return result
elif isinstance(obj, ast.Node) and not isinstance(obj, ast.LoopOverCoordinate): elif isinstance(obj, ast.Node) and not isinstance(obj, ast.LoopOverCoordinate):
return obj return obj
else: else:
......
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