From 22b42bc82a73c166564c76a3501a952f02d52da1 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Wed, 29 May 2002 15:51:24 +0000 Subject: [PATCH] 0.7.4.6: fixed bug 169 as per David Lichteblau sbcl-devel 2002-05-21 --- BUGS | 19 ------------------- NEWS | 5 +++++ src/compiler/ir1tran.lisp | 1 - tests/compiler.pure.lisp | 29 +++++++++++++++++++++++++++++ version.lisp-expr | 2 +- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/BUGS b/BUGS index ad7b82a..409cdf8 100644 --- a/BUGS +++ b/BUGS @@ -1230,25 +1230,6 @@ WORKAROUND: Since this is a reasonable user error, it shouldn't be reported as an SBCL bug. -169: - (reported by Alexey Dejneka on sbcl-devel 2002-05-12) - * (defun test (n) - (let ((*x* n)) - (declare (special *x*)) - (getx))) - ; in: LAMBDA NIL - ; (LET ((*X* N)) - ; (DECLARE (SPECIAL *X*)) - ; (GETX)) - ; - ; caught STYLE-WARNING: - ; using the lexical binding of the symbol *X*, not the - ; dynamic binding, even though the symbol name follows the usual naming - ; convention (names like *FOO*) for special variables - ; compilation unit finished - ; caught 1 STYLE-WARNING condition - But the code works as it should. Checked in 0.6.12.43 and later. - 171: (reported by Pierre Mai while investigating bug 47): (DEFCLASS FOO () ((A :SILLY T))) diff --git a/NEWS b/NEWS index 7ba2cfe..8e76c9b 100644 --- a/NEWS +++ b/NEWS @@ -1129,6 +1129,11 @@ changes in sbcl-0.7.4 relative to sbcl-0.7.3: changes in sbcl-0.7.5 relative to sbcl-0.7.4: * bug 140 fixed: redefinition of classes with different supertypes is now reflected in the type hierarchy. (thanks to Pierre Mai) + * bug 169 fixed: no more bogus warnings about using lexical bindings + despite the presence of perfectly good SPECIAL declarations. (thanks + to David Lichteblau) + * bug fix: Structure type predicate functions now check their argument + count as they should. * minor incompatible change: The LOAD function no longer, when given a wild pathname to load, loads all files matching that pathname; instead, an error of type FILE-ERROR is signalled. diff --git a/src/compiler/ir1tran.lisp b/src/compiler/ir1tran.lisp index fd63e74..19c2f89 100644 --- a/src/compiler/ir1tran.lisp +++ b/src/compiler/ir1tran.lisp @@ -1187,7 +1187,6 @@ :where-from (leaf-where-from specvar) :specvar specvar))) (t - (note-lexical-binding name) (make-lambda-var :%source-name name))))) ;;; Make the default keyword for a &KEY arg, checking that the keyword diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index b911c4f..73a6c7d 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -85,3 +85,32 @@ (list x))))) (assert (null value)) (assert (typep error 'error))) + +;;; bug 169 (reported by Alexey Dejneka 2002-05-12, fixed by David +;;; Lichteblau 2002-05-21) +(progn + (multiple-value-bind (fun warnings-p failure-p) + (compile nil + ;; Compiling this code should cause a STYLE-WARNING + ;; about *X* looking like a special variable but not + ;; being one. + '(lambda (n) + (let ((*x* n)) + (funcall (symbol-function 'x-getter)) + (print *x*)))) + (assert (functionp fun)) + (assert warnings-p) + (assert (not failure-p))) + (multiple-value-bind (fun warnings-p failure-p) + (compile nil + ;; Compiling this code should not cause a warning + ;; (because the DECLARE turns *X* into a special + ;; variable as its name suggests it should be). + '(lambda (n) + (let ((*x* n)) + (declare (special *x*)) + (funcall (symbol-function 'x-getter)) + (print *x*)))) + (assert (functionp fun)) + (assert (not warnings-p)) + (assert (not failure-p)))) diff --git a/version.lisp-expr b/version.lisp-expr index db90783..ba0edd8 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.4.5" +"0.7.4.6" -- 1.7.10.4