Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
a9b94f08
Commit
a9b94f08
authored
Jul 21, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The type analyzer now better supports closured variables
thanks Marius for the report
parent
423f0a7a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
8 deletions
+30
-8
src/analysis/type_analysis.cpp
src/analysis/type_analysis.cpp
+4
-0
test/tests/closure_name_error.py
test/tests/closure_name_error.py
+10
-0
test/tests/closure_test.py
test/tests/closure_test.py
+6
-8
test/tests/del_name_scoping.py
test/tests/del_name_scoping.py
+10
-0
No files found.
src/analysis/type_analysis.cpp
View file @
a9b94f08
...
...
@@ -384,6 +384,10 @@ private:
return
UNKNOWN
;
}
if
(
scope_info
->
refersToClosure
(
node
->
id
))
{
return
UNKNOWN
;
}
CompilerType
*&
t
=
sym_table
[
node
->
id
];
if
(
t
==
NULL
)
{
// if (VERBOSITY() >= 2) {
...
...
test/tests/closure_name_error.py
0 → 100644
View file @
a9b94f08
x3
=
0
def
bad_addr3
(
_x
):
if
0
:
x3
=
_
def
g
(
y3
):
return
x3
+
y3
return
g
print
bad_addr3
(
1
)(
2
)
test/tests/closure_test.py
View file @
a9b94f08
...
...
@@ -43,11 +43,9 @@ def make_addr3(x3):
return
g
print
make_addr3
(
10
)(
2
)
def
bad_addr3
(
_x
):
if
0
:
x3
=
_
def
g
(
y3
):
return
x3
+
y3
return
g
print
bad_addr3
(
1
)(
2
)
def
f4
(
args
):
def
inner
():
for
a
in
args
:
print
a
return
inner
print
f4
([
1
,
2
,
3
])()
test/tests/del_name_scoping.py
0 → 100644
View file @
a9b94f08
# expected: fail
# - deletes on names
x
=
1
def
f
():
if
0
:
# the del marks 'x' as a name written to in this scope
del
x
print
x
f
()
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