From e02c446f9d50a3cb95725e9673db2fe868a6b0e3 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 10 Sep 2009 19:33:52 -0700 Subject: [PATCH] Fix tests after #355 --- Cython/Compiler/Symtab.py | 2 ++ tests/errors/e_ctypedefornot.pyx | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) 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' """ -- 2.26.2