diff options
author | Robert Bradshaw <robertwb@gmail.com> | 2016-11-15 16:33:52 -0800 |
---|---|---|
committer | Robert Bradshaw <robertwb@gmail.com> | 2016-11-15 16:35:09 -0800 |
commit | db9591ab5d88d7e82e9196bc3f150353538c1e04 (patch) | |
tree | 0911201b786182631ebd4e20cc6192ed9f1178be | |
parent | f5b89afa9d8ad1217640a40445fb88082cb40e3d (diff) | |
download | cython-db9591ab5d88d7e82e9196bc3f150353538c1e04.tar.gz |
Fixes a bug with unanalysed ResultRefNodes.
This fixes #1523.
-rw-r--r-- | Cython/Compiler/UtilNodes.py | 1 | ||||
-rw-r--r-- | tests/run/unpack.pyx | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Cython/Compiler/UtilNodes.py b/Cython/Compiler/UtilNodes.py index fb1c9e9d8..862557c66 100644 --- a/Cython/Compiler/UtilNodes.py +++ b/Cython/Compiler/UtilNodes.py @@ -149,6 +149,7 @@ class ResultRefNode(AtomicExprNode): def analyse_types(self, env): if self.expression is not None: + self.expression = self.expression.analyse_types(env) self.type = self.expression.type return self diff --git a/tests/run/unpack.pyx b/tests/run/unpack.pyx index becb6fbe8..91bf4d634 100644 --- a/tests/run/unpack.pyx +++ b/tests/run/unpack.pyx @@ -393,3 +393,13 @@ def unpack_literal_none_to_exttype(): cdef ExtType a,b,c,d a, b = c, d = None, None return a,b,c,d + + +# Github issue #1523 +def test_unpack_resultref(): + """ + >>> test_unpack_resultref() + ((1, set([])), 1, set([])) + """ + a = b, c = 1, set() + return a, b, c |