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
f2e7d089
Commit
f2e7d089
authored
Mar 25, 2019
by
gsamain
Committed by
Xavier Thompson
Jun 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cpp: Bugfix: Fix Binop c++ operators type inference
parent
e89cc44d
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 @
f2e7d089
...
...
@@ -11214,7 +11214,8 @@ class BinopNode(ExprNode):
or
self
.
operand2
.
type
.
is_cpp_class
)
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
:
self
.
type_error
()
return
...
...
@@ -11409,7 +11410,14 @@ class NumBinopNode(BinopNode):
widest_type
,
PyrexTypes
.
c_int_type
)
return
widest_type
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
):
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