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
Boxiang Sun
cython
Commits
6b21b89a
Commit
6b21b89a
authored
Oct 07, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix C++ type inference.
parent
0fbb4898
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/TypeInference.py
Cython/Compiler/TypeInference.py
+3
-3
No files found.
Cython/Compiler/TypeInference.py
View file @
6b21b89a
...
@@ -494,7 +494,7 @@ def find_spanning_type(type1, type2):
...
@@ -494,7 +494,7 @@ def find_spanning_type(type1, type2):
return
PyrexTypes
.
c_double_type
return
PyrexTypes
.
c_double_type
return
result_type
return
result_type
def
simply_type
(
result_type
):
def
simply_type
(
result_type
,
pos
):
if
result_type
.
is_reference
:
if
result_type
.
is_reference
:
result_type
=
result_type
.
ref_base_type
result_type
=
result_type
.
ref_base_type
if
result_type
.
is_const
:
if
result_type
.
is_const
:
...
@@ -506,10 +506,10 @@ def simply_type(result_type):
...
@@ -506,10 +506,10 @@ def simply_type(result_type):
return
result_type
return
result_type
def
aggressive_spanning_type
(
types
,
might_overflow
,
pos
):
def
aggressive_spanning_type
(
types
,
might_overflow
,
pos
):
return
simply_type
(
reduce
(
find_spanning_type
,
types
))
return
simply_type
(
reduce
(
find_spanning_type
,
types
)
,
pos
)
def
safe_spanning_type
(
types
,
might_overflow
,
pos
):
def
safe_spanning_type
(
types
,
might_overflow
,
pos
):
result_type
=
simply_type
(
reduce
(
find_spanning_type
,
types
))
result_type
=
simply_type
(
reduce
(
find_spanning_type
,
types
)
,
pos
)
if
result_type
.
is_pyobject
:
if
result_type
.
is_pyobject
:
# In theory, any specific Python type is always safe to
# In theory, any specific Python type is always safe to
# infer. However, inferring str can cause some existing code
# infer. However, inferring str can cause some existing code
...
...
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