Commit b7ff8224 authored by 0dminnimda's avatar 0dminnimda Committed by GitHub

Turn the redeclaration of attributes as C methods into an error since it...

Turn the redeclaration of attributes as C methods into an error since it currently leads to difficult to predict behaviour. (#4661)
parent 97b8a0b9
......@@ -2439,7 +2439,8 @@ class CClassScope(ClassScope):
cname = punycodify_name(c_safe_identifier(name), Naming.unicode_vtabentry_prefix)
if entry:
if not entry.is_cfunction:
warning(pos, "'%s' redeclared " % name, 0)
error(pos, "'%s' redeclared " % name)
entry.already_declared_here()
else:
if defining and entry.func_cname:
error(pos, "'%s' already defined" % name)
......
# ticket: 600
# mode: error
cdef class Bar:
cdef list _operands
cdef int _operands(self):
return -1
_ERRORS = """
7:9: '_operands' redeclared
5:14: Previous declaration is here
"""
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