Commit e5973b71 authored by Robert Bradshaw's avatar Robert Bradshaw

Remove redundant lhs analysis.

parent 0756de96
...@@ -4753,8 +4753,6 @@ class SingleAssignmentNode(AssignmentNode): ...@@ -4753,8 +4753,6 @@ class SingleAssignmentNode(AssignmentNode):
from . import ExprNodes, UtilNodes from . import ExprNodes, UtilNodes
self.rhs = self.rhs.analyse_types(env) self.rhs = self.rhs.analyse_types(env)
self.lhs = self.lhs.analyse_target_types(env)
self.lhs.gil_assignment_check(env)
if self.rhs.type.is_ctuple and isinstance(self.lhs, ExprNodes.TupleNode): if self.rhs.type.is_ctuple and isinstance(self.lhs, ExprNodes.TupleNode):
if self.rhs.type.size == len(self.lhs.args): if self.rhs.type.size == len(self.lhs.args):
...@@ -4774,6 +4772,9 @@ class SingleAssignmentNode(AssignmentNode): ...@@ -4774,6 +4772,9 @@ class SingleAssignmentNode(AssignmentNode):
error(self.pos, "Unpacking type %s requires exactly %s arguments." % ( error(self.pos, "Unpacking type %s requires exactly %s arguments." % (
self.rhs.type, self.rhs.type.size)) self.rhs.type, self.rhs.type.size))
self.lhs = self.lhs.analyse_target_types(env)
self.lhs.gil_assignment_check(env)
if self.lhs.memslice_broadcast or self.rhs.memslice_broadcast: if self.lhs.memslice_broadcast or self.rhs.memslice_broadcast:
self.lhs.memslice_broadcast = True self.lhs.memslice_broadcast = True
self.rhs.memslice_broadcast = True self.rhs.memslice_broadcast = True
......
...@@ -52,10 +52,12 @@ def c_types(int a, double b): ...@@ -52,10 +52,12 @@ def c_types(int a, double b):
>>> c_types(1, 2) >>> c_types(1, 2)
(1, 2.0) (1, 2.0)
""" """
cdef int* a_ptr
cdef double* b_ptr
cdef (int*, double*) ab cdef (int*, double*) ab
ab[0] = &a ab[0] = &a
ab[1] = &b ab[1] = &b
a_ptr, b_ptr = ab[0], ab[1] a_ptr, b_ptr = ab
return a_ptr[0], b_ptr[0] return a_ptr[0], b_ptr[0]
cpdef (int, double) ctuple_return_type(x, y): cpdef (int, double) ctuple_return_type(x, y):
......
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