Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
704ba4da
Commit
704ba4da
authored
Jun 14, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure signature extensions reflected in the pxd if needed.
This fixes #1732.
parent
0ead474c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+5
-0
tests/errors/cmethbasematch.pyx
tests/errors/cmethbasematch.pyx
+25
-0
No files found.
Cython/Compiler/Symtab.py
View file @
704ba4da
...
@@ -2088,6 +2088,11 @@ class CClassScope(ClassScope):
...
@@ -2088,6 +2088,11 @@ class CClassScope(ClassScope):
# Fix with_gil vs nogil.
# Fix with_gil vs nogil.
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
elif
type
.
compatible_signature_with
(
entry
.
type
,
as_cmethod
=
1
)
and
type
.
nogil
==
entry
.
type
.
nogil
:
elif
type
.
compatible_signature_with
(
entry
.
type
,
as_cmethod
=
1
)
and
type
.
nogil
==
entry
.
type
.
nogil
:
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
)
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
:
error
(
pos
,
"Signature not compatible with previous declaration"
)
error
(
pos
,
"Signature not compatible with previous declaration"
)
...
...
tests/errors/cmethbasematch.pyx
View file @
704ba4da
...
@@ -8,7 +8,32 @@ cdef class D(C):
...
@@ -8,7 +8,32 @@ cdef class D(C):
cdef
void
f
(
self
,
int
x
):
cdef
void
f
(
self
,
int
x
):
pass
pass
# These are declared in the pxd.
cdef
class
Base
(
object
):
cdef
f
(
self
):
pass
cdef
class
MissingRedeclaration
(
Base
):
# Not declared (so assumed cdef) in the pxd.
cpdef
f
(
self
):
pass
cdef
class
BadRedeclaration
(
Base
):
# Declared as cdef in the pxd.
cpdef
f
(
self
):
pass
cdef
class
UnneededRedeclaration
(
Base
):
# This is OK, as it's not declared in the pxd.
cpdef
f
(
self
):
pass
_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
2:9: Previous declaration is here
23:8: Compatible but non-identical C method 'f' not redeclared in definition part of extension type
2:9: Previous declaration is here
"""
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment