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
a45374f2
Commit
a45374f2
authored
Mar 25, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Binop c++ operators type inference
parent
1336b25e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+10
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
a45374f2
...
@@ -11131,7 +11131,8 @@ class BinopNode(ExprNode):
...
@@ -11131,7 +11131,8 @@ class BinopNode(ExprNode):
or
self
.
operand2
.
type
.
is_cpp_class
)
or
self
.
operand2
.
type
.
is_cpp_class
)
def
analyse_cpp_operation
(
self
,
env
):
def
analyse_cpp_operation
(
self
,
env
):
entry
=
env
.
lookup_operator
(
self
.
operator
,
[
self
.
operand1
,
self
.
operand2
])
operator
=
self
.
operator
if
not
self
.
inplace
else
self
.
operator
+
"="
entry
=
env
.
lookup_operator
(
operator
,
[
self
.
operand1
,
self
.
operand2
])
if
not
entry
:
if
not
entry
:
self
.
type_error
()
self
.
type_error
()
return
return
...
@@ -11330,7 +11331,14 @@ class NumBinopNode(BinopNode):
...
@@ -11330,7 +11331,14 @@ class NumBinopNode(BinopNode):
widest_type
,
PyrexTypes
.
c_int_type
)
widest_type
,
PyrexTypes
.
c_int_type
)
return
widest_type
return
widest_type
else
:
else
:
return
None
cpp_type
=
None
operator
=
self
.
operator
if
not
self
.
inplace
else
self
.
operator
+
"="
if
type1
.
is_cpp_class
or
type1
.
is_ptr
:
cpp_type
=
type1
.
find_cpp_operation_type
(
operator
,
type2
)
if
cpp_type
is
None
and
(
type2
.
is_cpp_class
or
type2
.
is_ptr
):
cpp_type
=
type2
.
find_cpp_operation_type
(
operator
,
type1
)
# FIXME: do we need to handle other cases here?
return
cpp_type
def
may_be_none
(
self
):
def
may_be_none
(
self
):
if
self
.
type
and
self
.
type
.
is_builtin_type
:
if
self
.
type
and
self
.
type
.
is_builtin_type
:
...
...
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