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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
6cd7c8f3
Commit
6cd7c8f3
authored
Jul 25, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid const types in inference.
This fixes #1798.
parent
fb5e9200
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-0
tests/run/cdivision_CEP_516.pyx
tests/run/cdivision_CEP_516.pyx
+11
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
6cd7c8f3
...
@@ -4338,6 +4338,10 @@ def widest_numeric_type(type1, type2):
...
@@ -4338,6 +4338,10 @@ def widest_numeric_type(type1, type2):
type1
=
type1
.
ref_base_type
type1
=
type1
.
ref_base_type
if
type2
.
is_reference
:
if
type2
.
is_reference
:
type2
=
type2
.
ref_base_type
type2
=
type2
.
ref_base_type
if
type1
.
is_const
:
type1
=
type1
.
const_base_type
if
type2
.
is_const
:
type2
=
type2
.
const_base_type
if
type1
==
type2
:
if
type1
==
type2
:
widest_type
=
type1
widest_type
=
type1
elif
type1
.
is_complex
or
type2
.
is_complex
:
elif
type1
.
is_complex
or
type2
.
is_complex
:
...
...
tests/run/cdivision_CEP_516.pyx
View file @
6cd7c8f3
...
@@ -191,3 +191,14 @@ def py_div_long(long a, long b):
...
@@ -191,3 +191,14 @@ def py_div_long(long a, long b):
OverflowError: ...
OverflowError: ...
"""
"""
return
a
/
b
return
a
/
b
def
c_div_const_test
(
a
,
b
):
"""
>>> c_div_const_test(5, 3)
1
"""
return
c_div_const
(
a
,
b
)
cdef
long
c_div_const
(
const
long
a
,
int
b
):
cdef
long
c
=
a
/
b
return
c
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