fix plai/gc2/mutator for the case where a lambda-bound
variable is shadowing something
This commit is contained in:
parent
0e6975fb2c
commit
092d98656c
|
@ -206,7 +206,11 @@
|
|||
(syntax-case stx ()
|
||||
[(_ (id ...) body)
|
||||
(let ([env-roots (syntax-parameter-value #'mutator-env-roots)])
|
||||
(with-syntax ([(free-id ...) (map syntax-local-introduce (find-referenced-locals env-roots stx))]
|
||||
(with-syntax ([(free-id ...) (map syntax-local-introduce
|
||||
(filter
|
||||
(λ (x) (for/and ([id (in-list (syntax->list #'(id ...)))])
|
||||
(not (free-identifier=? id x))))
|
||||
(find-referenced-locals env-roots stx)))]
|
||||
[(env-id ...) env-roots]
|
||||
[closure (or (syntax-parameter-value #'mutator-name)
|
||||
(syntax-local-name)
|
||||
|
|
6
collects/tests/plai/gc2/good-mutators/nested-lam.rkt
Normal file
6
collects/tests/plai/gc2/good-mutators/nested-lam.rkt
Normal file
|
@ -0,0 +1,6 @@
|
|||
#lang plai/gc2/mutator
|
||||
(allocator-setup "../good-collectors/good-collector.rkt" 40)
|
||||
(let ([x 1])
|
||||
((λ (x)
|
||||
x)
|
||||
x))
|
Loading…
Reference in New Issue
Block a user