From: Robert Bradshaw Date: Thu, 14 Jan 2010 22:30:29 +0000 (-0800) Subject: Some reference type refinements. X-Git-Tag: 0.13.beta0~353^2~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7de6fd50ea6eaffa3ef6bba3d2ec2446b535e5cf;p=cython.git Some reference type refinements. --- 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