summaryrefslogtreecommitdiff
path: root/test-suite/tests/peval.test
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-10-10 11:19:02 +0200
committerAndy Wingo <wingo@pobox.com>2013-10-10 11:19:19 +0200
commit4a6d35197939e64720e4467b41cfe8ac0a917ec8 (patch)
tree7a5b9f1374173fc8197898c0640b3f0eef480873 /test-suite/tests/peval.test
parent61c7264fccd44cf1cd3c7401b6c23dc7c26fa9d8 (diff)
downloadguile-4a6d35197939e64720e4467b41cfe8ac0a917ec8.tar.gz
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.
Diffstat (limited to 'test-suite/tests/peval.test')
-rw-r--r--test-suite/tests/peval.test10
1 files changed, 9 insertions, 1 deletions
diff --git a/test-suite/tests/peval.test b/test-suite/tests/peval.test
index 270224ecb..0949ddf0e 100644
--- a/test-suite/tests/peval.test
+++ b/test-suite/tests/peval.test
@@ -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))))