From: Robert Bradshaw Date: Fri, 11 Sep 2009 02:33:52 +0000 (-0700) Subject: Fix tests after #355 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e02c446f9d50a3cb95725e9673db2fe868a6b0e3;p=cython.git Fix tests after #355 --- diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 97cb026a..b649fbaa 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -1014,6 +1014,8 @@ class ModuleScope(Scope): # the non-typedef struct internally to avoid needing forward # declarations for anonymous structs. if typedef_flag and visibility != 'extern': + if visibility != 'public': + warning(pos, "ctypedef only valid for public and extern classes", 2) objtypedef_cname = objstruct_cname objstruct_cname = None typedef_flag = 0 diff --git a/tests/errors/e_ctypedefornot.pyx b/tests/errors/e_ctypedefornot.pyx index 1e9491ae..a0e18237 100644 --- a/tests/errors/e_ctypedefornot.pyx +++ b/tests/errors/e_ctypedefornot.pyx @@ -8,16 +8,10 @@ ctypedef struct Blarg: cdef struct Blarg -cdef class Spam - -ctypedef class Spam: - pass - cdef Foo f cdef Blarg b _ERRORS = u""" 3:0: 'Foo' previously declared using 'cdef' 9:5: 'Blarg' previously declared using 'ctypedef' -13:0: 'Spam' previously declared using 'cdef' """