Commit 21a06f93 authored by Stefan Behnel's avatar Stefan Behnel

fix crash in MarkParallelAssignments transform when it hits a type inferred...

fix crash in MarkParallelAssignments transform when it hits a type inferred TypedExprNode that lacks pos/subexprs
parent 18e16cb7
...@@ -12,8 +12,10 @@ from .Visitor import CythonTransform, EnvTransform ...@@ -12,8 +12,10 @@ from .Visitor import CythonTransform, EnvTransform
class TypedExprNode(ExprNodes.ExprNode): class TypedExprNode(ExprNodes.ExprNode):
# Used for declaring assignments of a specified type without a known entry. # Used for declaring assignments of a specified type without a known entry.
def __init__(self, type): subexprs = []
self.type = type
def __init__(self, type, pos=None):
super(TypedExprNode, self).__init__(pos, type=type)
object_expr = TypedExprNode(py_object_type) object_expr = TypedExprNode(py_object_type)
...@@ -184,10 +186,10 @@ class MarkParallelAssignments(EnvTransform): ...@@ -184,10 +186,10 @@ class MarkParallelAssignments(EnvTransform):
# use fake expressions with the right result type # use fake expressions with the right result type
if node.star_arg: if node.star_arg:
self.mark_assignment( self.mark_assignment(
node.star_arg, TypedExprNode(Builtin.tuple_type)) node.star_arg, TypedExprNode(Builtin.tuple_type, node.pos))
if node.starstar_arg: if node.starstar_arg:
self.mark_assignment( self.mark_assignment(
node.starstar_arg, TypedExprNode(Builtin.dict_type)) node.starstar_arg, TypedExprNode(Builtin.dict_type, node.pos))
EnvTransform.visit_FuncDefNode(self, node) EnvTransform.visit_FuncDefNode(self, node)
return node return node
......
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