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
9cb546ce
Commit
9cb546ce
authored
Mar 25, 2019
by
gsamain
Committed by
Xavier Thompson
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct type inference for CallNode
parent
739641a9
Changes
1
Hide 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 @
9cb546ce
...
...
@@ -5534,9 +5534,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'
):
alternatives
=
self
.
function
.
entry
.
all_alternatives
()
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