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
5c11dcd3
Commit
5c11dcd3
authored
Apr 25, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix C++ function matching: Entry objects are not ordered
parent
390042f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+3
-3
No files found.
Cython/Compiler/PyrexTypes.py
View file @
5c11dcd3
...
@@ -2546,7 +2546,7 @@ def best_match(args, functions, pos=None):
...
@@ -2546,7 +2546,7 @@ def best_match(args, functions, pos=None):
possibilities
=
[]
possibilities
=
[]
bad_types
=
[]
bad_types
=
[]
for
func
,
func_type
in
candidates
:
for
index
,
(
func
,
func_type
)
in
enumerate
(
candidates
)
:
score
=
[
0
,
0
,
0
]
score
=
[
0
,
0
,
0
]
for
i
in
range
(
min
(
len
(
args
),
len
(
func_type
.
args
))):
for
i
in
range
(
min
(
len
(
args
),
len
(
func_type
.
args
))):
src_type
=
args
[
i
].
type
src_type
=
args
[
i
].
type
...
@@ -2566,14 +2566,14 @@ def best_match(args, functions, pos=None):
...
@@ -2566,14 +2566,14 @@ def best_match(args, functions, pos=None):
bad_types
.
append
((
func
,
error_mesg
))
bad_types
.
append
((
func
,
error_mesg
))
break
break
else
:
else
:
possibilities
.
append
((
score
,
func
))
# so we can sort it
possibilities
.
append
((
score
,
index
,
func
))
# so we can sort it
if
possibilities
:
if
possibilities
:
possibilities
.
sort
()
possibilities
.
sort
()
if
len
(
possibilities
)
>
1
and
possibilities
[
0
][
0
]
==
possibilities
[
1
][
0
]:
if
len
(
possibilities
)
>
1
and
possibilities
[
0
][
0
]
==
possibilities
[
1
][
0
]:
if
pos
is
not
None
:
if
pos
is
not
None
:
error
(
pos
,
"ambiguous overloaded method"
)
error
(
pos
,
"ambiguous overloaded method"
)
return
None
return
None
return
possibilities
[
0
][
1
]
return
possibilities
[
0
][
-
1
]
if
pos
is
not
None
:
if
pos
is
not
None
:
if
len
(
bad_types
)
==
1
:
if
len
(
bad_types
)
==
1
:
error
(
pos
,
bad_types
[
0
][
1
])
error
(
pos
,
bad_types
[
0
][
1
])
...
...
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