From c113123565a4d076808f7d3f385ffd5798bb95b7 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 6 Jun 2007 19:02:58 -0700 Subject: [PATCH] type narrowing for pxd files --- Cython/Compiler/Symtab.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 2e97dfcd..9c114657 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -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, -- 2.26.2