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