Warning, not error, on builting type redeclaration.
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 25 Mar 2009 22:54:27 +0000 (15:54 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 25 Mar 2009 22:54:27 +0000 (15:54 -0700)
Throwing an error is to invasive for 0.11.x, and also one needs to be able to subclass/access attributes of builtin types before we get rid of the declaration altogether.

Cython/Compiler/Nodes.py
tests/errors/builtin_type_conflict_T170.pyx

index 60dbc28cbf68787728291adee9db64233f6cd83d..68f12906440db53a9c1385b55effcca8a7742ac6 100644 (file)
@@ -2679,8 +2679,7 @@ class CClassDefNode(ClassDefNode):
 
         if self.visibility == 'extern':
             if self.module_name == '__builtin__' and self.class_name in Builtin.builtin_types:
-                error(self.pos, "%s already a builtin Cython type" % self.class_name)
-                return
+                warning(self.pos, "%s already a builtin Cython type" % self.class_name, 1)
 
         self.entry = home_scope.declare_c_class(
             name = self.class_name, 
index c1c8ac900d77abfb4eec4ddf7c72c03e65a6e847..89d415361d6dcb0c28c64bb4625de303902cb458 100644 (file)
@@ -3,6 +3,13 @@ cdef extern from *:
         pass
 
 cdef list foo = []
-_ERRORS = u"""
+
+# This is too invasive for Python 0.11.x, re-enable in 0.12
+NEW_ERRORS = u"""
 :2:4: list already a builtin Cython type
 """
+
+_ERRORS = u"""
+:5:16: Cannot coerce list to type 'list'
+"""
+