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
d8a06e2a
Commit
d8a06e2a
authored
Mar 25, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct type inference for CallNode
parent
db15895f
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 @
d8a06e2a
...
@@ -5407,9 +5407,18 @@ class CallNode(ExprNode):
...
@@ -5407,9 +5407,18 @@ class CallNode(ExprNode):
func_type
=
entry
.
type
or
func_type
func_type
=
entry
.
type
or
func_type
if
func_type
.
is_ptr
:
if
func_type
.
is_ptr
:
func_type
=
func_type
.
base_type
func_type
=
func_type
.
base_type
if
func_type
.
is_cfunction
:
if
func_type
.
is_cfunction
or
func_type
.
is_cyp_class
:
if
getattr
(
self
.
function
,
'entry'
,
None
)
and
hasattr
(
self
,
'args'
):
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
()
alternatives
=
self
.
function
.
entry
.
all_alternatives
()
if
alternatives
:
arg_types
=
[
arg
.
infer_type
(
env
)
for
arg
in
self
.
args
]
arg_types
=
[
arg
.
infer_type
(
env
)
for
arg
in
self
.
args
]
func_entry
=
PyrexTypes
.
best_match
(
arg_types
,
alternatives
)
func_entry
=
PyrexTypes
.
best_match
(
arg_types
,
alternatives
)
if
func_entry
:
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