* IR1-CONVERT-HAIRY-LAMBDA used to give optional dispatch entry points
`(&OPTIONAL-DISPATCH ,(OR <DEBUG-NAME> <SOURCE-NAME>)) as debug-name.
Don't do that -- just use the provided DEBUG-NAME directly (it's
NIL in the cases we most care about, leaving the functional with
just a source-name). This fixes two issues:
1. Functions with non-required arguments didn't get the derived
type information saved in the infodb. FINALIZE-XEP-DEFINITION
didn't set the INFO entries properly because
(eq (leaf-source-name leaf) (functional-debug-name leaf))
was false -- it's true only if there is no separate debug-name.
2. Functions with non-required arguments printed as
#<FUNCTION (SB-C::&OPTIONAL-DISPATCH READ-LINE) {
10AD8345}>
because non-NIL debug-name is preferred over the source-name.
* Test-cases.
* bug fix: COMPILE-FILE did not warn about undefined variable
references at toplevel, and LOAD of the resulting fasl did
not signal an error.
+ * bug fix: functions with non-required arguments used to end up with
+ (SB-C::&OPTIONAL-DISPATCH ...) as their name.
+ * bug fix: redefining a function with non-required arguments didn't
+ update the system's knowledge about its call signature properly.
changes in sbcl-1.0.21 relative to 1.0.20:
* new feature: the compiler is able to track the effective type of a
:allowp allowp
:keyp keyp
:%source-name source-name
- :%debug-name (debug-name '&optional-dispatch
- (or debug-name source-name))
+ :%debug-name debug-name
:plist `(:ir1-environment
(,*lexenv*
,*current-path*))))
(with-test (:name :complex-call-doesnt-warn)
(handler-bind ((warning #'error))
(compile nil '(lambda (x) (complex-function-signature x :z1 1 :z2 2)))))
+
+(with-test (:name :non-required-args-update-info)
+ (let ((name (gensym "NON-REQUIRE-ARGS-TEST"))
+ (*evaluator-mode* :compile))
+ (eval `(defun ,name (x) x))
+ (assert (equal '(function (t) (values t &optional))
+ (sb-kernel:type-specifier (sb-int:info :function :type name))))
+ (eval `(defun ,name (x &optional y) (or x y)))
+ (assert (equal '(function (t &optional t) (values t &optional))
+ (sb-kernel:type-specifier (sb-int:info :function :type name))))))
+
\f
;;;; tests not in the problem domain, but of the consistency of the
;;;; compiler machinery itself
(destructuring-bind (a (b c) d) '(1 "foo" 4)
(+ a b c d)))))
:feh))))))
+
+;;; Functions with non-required arguments used to end up with
+;;; (&OPTIONAL-DISPATCH ...) as their names.
+(with-test (:name :hairy-function-name)
+ (assert (eq 'read-line (nth-value 2 (function-lambda-expression #'read-line))))
+ (assert (equal "#<FUNCTION READ-LINE>" (princ-to-string #'read-line))))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.21.26"
+"1.0.21.27"