From 7de6fd50ea6eaffa3ef6bba3d2ec2446b535e5cf Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 14 Jan 2010 14:30:29 -0800 Subject: [PATCH] Some reference type refinements. --- Cython/Compiler/PyrexTypes.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 8fa3836b..add37a96 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -1383,15 +1383,9 @@ class CReferenceType(CType): def assignable_from_resolved_type(self, other_type): if other_type is error_type: return 1 - if other_type.is_ptr: - return 0 - #print self, other_type - #if other_type.base_type == self.base_type: - # return 1 - #else: - # pass - #TODO: should send a warning message: initialization from incompatible pointer type (in C/C++) - if other_type == self.base_type: + elif other_type.is_reference and self.base_type == other_type.base_type: + return 1 + elif other_type == self.base_type: return 1 else: #for now return 0 -- 2.26.2