From 1291f475df3fb719f89f5da3763e58d5091d33b9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 30 Jun 2021 06:43:36 -0700 Subject: compiler: inline lambda: another apply-list diagnosis bug. * stdlib/compiler.tl (lambda-apply-transform): There is a bug in the case when all required and optional parameters have been satisfied. In the sub-case when there are no fixed parameters, we need to handle the run-time situation of there being a non-empty apply list, but no rest variable. --- stdlib/compiler.tl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'stdlib') diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl index d00e8d1e..3d89abed 100644 --- a/stdlib/compiler.tl +++ b/stdlib/compiler.tl @@ -2036,8 +2036,14 @@ ,*(nthcdr pars.nfix ^(,*fix-arg-exprs ,apply-list-expr))))) (lambda-too-many-args lm-expr)) - (when (or pars.rest apply-list-expr) - (add ^(,(or pars.rest ign-1) ,apply-list-expr))))) + (cond + ((and pars.rest apply-list-expr) + (add ^(,pars.rest ,al-val))) + (pars.rest + ^(,pars.rest nil)) + (apply-list-expr + (add ^(,ign-2 (if ,al-val + (lambda-excess-apply-list)))))))) ((and fix-vals apply-list-expr) (lambda-too-many-args lm-expr)) (apply-list-expr -- cgit v1.2.3