Commit f0f6ec36 authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #1734 from jdemeyer/class_name_in_error

Mention class name in error messages
parents 49806245 b2087f09
......@@ -2091,7 +2091,7 @@ class CClassScope(ClassScope):
if self.defined and not in_pxd:
error(pos,
"Compatible but non-identical C method '%s' not redeclared "
"in definition part of extension type" % name)
"in definition part of extension type '%s'" % (name, self.class_name))
error(entry.pos, "Previous declaration is here")
entry = self.add_cfunction(name, type, pos, cname, visibility='ignore', modifiers=modifiers)
else:
......@@ -2101,7 +2101,7 @@ class CClassScope(ClassScope):
if self.defined:
error(pos,
"C method '%s' not previously declared in definition part of"
" extension type" % name)
" extension type '%s'" % (name, self.class_name))
entry = self.add_cfunction(name, type, pos, cname, visibility, modifiers)
if defining:
entry.func_cname = self.mangle(Naming.func_prefix, name)
......
......@@ -32,8 +32,8 @@ cdef class UnneededRedeclaration(Base):
_ERRORS = u"""
8: 9: Signature not compatible with previous declaration
4: 9: Previous declaration is here
18:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type
18:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'MissingRedeclaration'
2:9: Previous declaration is here
23:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type
23:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type 'BadRedeclaration'
2:9: 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