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
131b1666
Commit
131b1666
authored
Mar 25, 2019
by
gsamain
Committed by
Xavier Thompson
Jun 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct type inference for CallNode
parent
54f4e190
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+12
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
131b1666
...
...
@@ -5483,9 +5483,18 @@ class CallNode(ExprNode):
func_type
=
entry
.
type
or
func_type
if
func_type
.
is_ptr
:
func_type
=
func_type
.
base_type
if
func_type
.
is_cfunction
:
if
getattr
(
self
.
function
,
'entry'
,
None
)
and
hasattr
(
self
,
'args'
):
if
func_type
.
is_cfunction
or
func_type
.
is_cyp_class
:
alternatives
=
None
cypclass_wrapper_entry
=
None
if
func_type
.
is_cyp_class
:
cypclass_wrapper_entry
=
func_type
.
scope
.
lookup_here
(
"<constructor>"
)
func_type
=
cypclass_wrapper_entry
.
type
if
hasattr
(
self
,
'args'
):
if
cypclass_wrapper_entry
:
alternatives
=
cypclass_wrapper_entry
.
all_alternatives
()
elif
getattr
(
self
.
function
,
'entry'
,
None
):
alternatives
=
self
.
function
.
entry
.
all_alternatives
()
if
alternatives
:
arg_types
=
[
arg
.
infer_type
(
env
)
for
arg
in
self
.
args
]
func_entry
=
PyrexTypes
.
best_match
(
arg_types
,
alternatives
)
if
func_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