Commit e1881e05 authored by Robert Bradshaw's avatar Robert Bradshaw

Warning, not error, on builting type redeclaration.

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.
parent 042c55d5
...@@ -2679,8 +2679,7 @@ class CClassDefNode(ClassDefNode): ...@@ -2679,8 +2679,7 @@ class CClassDefNode(ClassDefNode):
if self.visibility == 'extern': if self.visibility == 'extern':
if self.module_name == '__builtin__' and self.class_name in Builtin.builtin_types: 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) warning(self.pos, "%s already a builtin Cython type" % self.class_name, 1)
return
self.entry = home_scope.declare_c_class( self.entry = home_scope.declare_c_class(
name = self.class_name, name = self.class_name,
......
...@@ -3,6 +3,13 @@ cdef extern from *: ...@@ -3,6 +3,13 @@ cdef extern from *:
pass pass
cdef list foo = [] 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 :2:4: list already a builtin Cython type
""" """
_ERRORS = u"""
:5:16: Cannot coerce list to type 'list'
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment