type narrowing for pxd files
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 7 Jun 2007 02:02:58 +0000 (19:02 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 7 Jun 2007 02:02:58 +0000 (19:02 -0700)
Cython/Compiler/Symtab.py

index 2e97dfcd6e7e6ee0f2e748502f3d0e0f3815f04a..9c114657be4b361199f756d881fcd1831131a892 100644 (file)
@@ -1074,12 +1074,10 @@ class CClassScope(ClassScope):
             else:
                 if defining and entry.func_cname:
                     error(pos, "'%s' already defined" % name)
-                if not entry.type.same_as(type, as_cmethod = 1):
-                    old_type = entry.type
-                    if type.narrower_c_signature_than(entry.type, as_cmethod = 1):
-                        entry.type = type
-                    else:
-                        error(pos, "Signature not compatible with previous declaration")
+                if type.narrower_c_signature_than(entry.type, as_cmethod = 1):
+                    entry.type = type
+                else:
+                    error(pos, "Signature not compatible with previous declaration")
         else:
             if self.defined:
                 error(pos,