Commit 9dcc3e46 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix another is_defined-related bug

It all feel pretty hacked together though... definitely not
confident that I've gotten all of them.
parent 7f3b97db
......@@ -1004,6 +1004,11 @@ class IRGeneratorImpl : public IRGenerator {
}
prev = val;
val->incvref();
// Clear out the is_defined name since it is now definitely defined:
assert(!startswith(name, "!is_defined"));
std::string defined_name = _getFakeName("is_defined", name.c_str());
_getFake(defined_name, true);
}
}
......
# expected: fail
print [(i, j) for i in range(4) for j in range(4)]
def f():
......@@ -20,7 +18,7 @@ f(1, 1)
# TODO: test on ifs
def f():
print [(i, j) for (i, j) in {1:2, 3:4, 5:6, 7:8}.items()]
print [(i, j) for (i, j) in sorted({1:2, 3:4, 5:6, 7:8}.items())]
f()
# The expr should not get evaluated if the if-condition fails:
......
# expected: fail
i = "global"
def f(n):
i = "hello"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment