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
361b5d08
Commit
361b5d08
authored
Jul 03, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More loop type inference fixes.
parent
066c0e1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
361b5d08
...
...
@@ -2010,7 +2010,10 @@ class IteratorNode(ExprNode):
begin
=
sequence_type
.
scope
.
lookup
(
"begin"
)
if
begin
is
not
None
:
return
begin
.
type
.
base_type
.
return_type
return
py_object_type
elif
sequence_type
.
is_pyobject
:
return
sequence_type
else
:
return
py_object_type
def
analyse_cpp_types
(
self
,
env
):
sequence_type
=
self
.
sequence
.
type
...
...
@@ -2222,7 +2225,11 @@ class NextNode(AtomicExprNode):
item_type
=
item_type
.
ref_base_type
return
item_type
else
:
return
py_object_type
# Avoid duplication of complicated logic.
fake_index_node
=
IndexNode
(
self
.
pos
,
base
=
self
.
iterator
,
index
=
IntNode
(
self
.
pos
,
value
=
'0'
))
return
fake_index_node
.
infer_type
(
env
)
def
analyse_types
(
self
,
env
):
self
.
type
=
self
.
infer_type
(
env
,
self
.
iterator
.
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