fix type inference for ResultRefNode
authorStefan Behnel <scoder@users.berlios.de>
Tue, 30 Nov 2010 06:58:52 +0000 (07:58 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 30 Nov 2010 06:58:52 +0000 (07:58 +0100)
Cython/Compiler/UtilNodes.py

index 4b5a90c3b984274d065e3091fae91ff795b42d89..5222b39ef7a77d3651c9da0cb7d199131d1e988d 100644 (file)
@@ -141,6 +141,9 @@ class ResultRefNode(AtomicExprNode):
     def infer_type(self, env):
         if self.expression is not None:
             return self.expression.infer_type(env)
+        if self.type is not None:
+            return self.type
+        assert False, "cannot infer type of ResultRefNode"
 
     def may_be_none(self):
         if not self.type.is_pyobject: