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
0888723e
Commit
0888723e
authored
Dec 18, 2009
by
daniloaf@daniloaf-PC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing best match removing ambiguity with pointer and reference
parent
aea63286
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+10
-6
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+5
-5
No files found.
Cython/Compiler/PyrexTypes.py
View file @
0888723e
#
# Pyrex - Types
#
...
...
@@ -1383,10 +1384,12 @@ class CReferenceType(CType):
if
other_type
is
error_type
:
return
1
if
other_type
.
is_ptr
:
if
other_type
.
base_type
==
self
.
base_type
:
return
1
else
:
pass
return
0
#print self, other_type
#if other_type.base_type == self.base_type:
# return 1
#else:
# pass
#TODO: should send a warning message: initialization from incompatible pointer type (in C/C++)
if
other_type
==
self
.
base_type
:
return
1
...
...
@@ -2240,8 +2243,9 @@ def best_match(args, functions, pos):
src_type
=
args
[
i
].
type
dst_type
=
func_type
.
args
[
i
].
type
if
dst_type
.
assignable_from
(
src_type
):
#print src_type, src_type.is_pyobject, dst_type, dst_type.is_pyobject
if
src_type
==
dst_type
or
(
dst_type
.
is_reference
and
src_type
==
dst_type
.
base_type
):
if
src_type
==
dst_type
or
(
dst_type
.
is_reference
and
\
src_type
==
dst_type
.
base_type
)
or
\
dst_type
.
same_as
(
src_type
):
pass
# score 0
elif
is_promotion
(
src_type
,
dst_type
):
score
[
2
]
+=
1
...
...
Cython/Compiler/Symtab.py
View file @
0888723e
...
...
@@ -311,11 +311,11 @@ class Scope(object):
entry.in_cinclude = self.in_cinclude
if name:
entry.qualified_name = self.qualify_name(name)
#
if name in entries and self.is_cpp():
#
entries[name].overloaded_alternatives.append(entry)
#
else:
#
entries[name] = entry
entries[name] = entry
if name in entries and self.is_cpp():
entries[name].overloaded_alternatives.append(entry)
else:
entries[name] = entry
#
entries[name] = entry
entry.scope = self
entry.visibility = visibility
return entry
...
...
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