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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
544937bf
Commit
544937bf
authored
Mar 07, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct CppClassScope to allow method overloading with different signature
parent
271db8ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+7
-4
No files found.
Cython/Compiler/Symtab.py
View file @
544937bf
...
...
@@ -2420,15 +2420,17 @@ class CppClassScope(Scope):
cname
=
name
entry
=
self
.
lookup_here
(
name
)
if
defining
and
entry
is
not
None
:
if
entry
.
type
.
same_as
(
type
):
if
type
.
is_cfunction
:
entry
=
self
.
declare
(
name
,
cname
,
type
,
pos
,
visibility
)
elif
entry
.
type
.
same_as
(
type
):
# Fix with_gil vs nogil.
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
elif
type
.
is_cfunction
and
type
.
compatible_signature_with
(
entry
.
type
):
entry
.
type
=
type
else
:
error
(
pos
,
"Function signature does not match previous declaration"
)
else
:
entry
=
self
.
declare
(
name
,
cname
,
type
,
pos
,
visibility
)
if
type
.
is_cfunction
and
not
defining
:
entry
.
is_inherited
=
1
entry
.
is_variable
=
1
entry
.
is_cfunction
=
type
.
is_cfunction
if
type
.
is_cfunction
and
self
.
type
:
...
...
@@ -2466,7 +2468,8 @@ class CppClassScope(Scope):
if
base_entry
and
not
base_entry
.
type
.
nogil
:
error
(
pos
,
"Constructor cannot be called without GIL unless all base constructors can also be called without GIL"
)
error
(
base_entry
.
pos
,
"Base constructor defined here."
)
prev_entry
=
self
.
lookup_here
(
name
)
# The previous entries management is now done directly in Scope.declare
#prev_entry = self.lookup_here(name)
entry
=
self
.
declare_var
(
name
,
type
,
pos
,
defining
=
defining
,
cname
=
cname
,
visibility
=
visibility
)
...
...
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