Skip to content

Commit f48f6e0

Browse files
committed
Don't mark record names as free variables
In `a.b`, `b` is not free; it's functionally a string.
1 parent 36d4083 commit f48f6e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scrapscript.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ def free_in(exp: Object) -> Set[str]:
11621162
if isinstance(exp, Apply):
11631163
return free_in(exp.func) | free_in(exp.arg)
11641164
if isinstance(exp, Access):
1165-
return free_in(exp.obj) | free_in(exp.at)
1165+
return free_in(exp.obj)
11661166
if isinstance(exp, Where):
11671167
assert isinstance(exp.binding, Assign)
11681168
return (free_in(exp.body) - {exp.binding.name.name}) | free_in(exp.binding)
@@ -3513,7 +3513,7 @@ def test_apply(self) -> None:
35133513
self.assertEqual(free_in(Apply(Var("x"), Var("y"))), {"x", "y"})
35143514

35153515
def test_access(self) -> None:
3516-
self.assertEqual(free_in(Access(Var("x"), Var("y"))), {"x", "y"})
3516+
self.assertEqual(free_in(Access(Var("x"), Var("y"))), {"x"})
35173517

35183518
def test_where(self) -> None:
35193519
exp = parse(tokenize("x . x = 1"))

0 commit comments

Comments
 (0)