mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 20:30:28 +02:00
Fix peval bug with inlining and optional argument initializers
* module/language/tree-il/peval.scm (peval): Fix a bug whereby inlined function applications with default argument initializers were putting the initializers in the wrong scope. * test-suite/tests/peval.test ("partial evaluation"): Add a test.
This commit is contained in:
parent
61c7264fcc
commit
4a6d351979
2 changed files with 49 additions and 19 deletions
|
@ -1279,4 +1279,12 @@
|
|||
(pass-if-peval
|
||||
(call-with-values foo (lambda (x) (bar x)))
|
||||
(let (x) (_) ((call (toplevel foo)))
|
||||
(call (toplevel bar) (lexical x _)))))
|
||||
(call (toplevel bar) (lexical x _))))
|
||||
|
||||
(pass-if-peval
|
||||
((lambda (foo)
|
||||
(define* (bar a #:optional (b (1+ a)))
|
||||
(list a b))
|
||||
(bar 1))
|
||||
1)
|
||||
(primcall list (const 1) (const 2))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue