as specified by AMOP.
* optimization: faster LOGCOUNT implementation on x86 and x86-64
(thanks to Lutz Euler)
+ * bug fix: improved the handling of type declarations and the
+ detection of violations for keyword arguments with non-constant
+ defaults.
changes in sbcl-0.9.15 relative to sbcl-0.9.14:
* added support for the ucs-2 external format. (contributed by Ivan
(n-val (make-symbol (format nil
"~A-DEFAULTING-TEMP"
(leaf-source-name key))))
- (key-type (leaf-type key))
- (val-temp (make-lambda-var
- :%source-name n-val
- :type (if hairy-default
- (type-union key-type (specifier-type 'null))
- key-type))))
+ (val-temp (make-lambda-var :%source-name n-val)))
(main-vars val-temp)
(bind-vars key)
(cond ((or hairy-default supplied-p)
(list (funcall #'target-fun 1 4) (funcall 'target-fun 1 4))))
(test-target-fun-called #'caller-fun-3 (list -3 5))
-;; Reported by NIIMI Satoshi
-;; Subject: [Sbcl-devel] compilation error with optimization
-;; Date: Sun, 09 Apr 2006 17:36:05 +0900
+;;; Reported by NIIMI Satoshi
+;;; Subject: [Sbcl-devel] compilation error with optimization
+;;; Date: Sun, 09 Apr 2006 17:36:05 +0900
(defun test-minimal-debug-info-for-unstored-but-used-parameter (n a)
(declare (optimize (speed 3)
(debug 1)))
0
(test-minimal-debug-info-for-unstored-but-used-parameter (1- n) a)))
+;;; &KEY arguments with non-constant defaults.
+(declaim (notinline opaque-identity))
+(defun opaque-identity (x) x)
+(defstruct tricky-defaults
+ (fun #'identity :type function)
+ (num (opaque-identity 3) :type fixnum))
+(macrolet ((frob (form expected-expected-type)
+ `(handler-case ,form
+ (type-error (c) (assert (eq (type-error-expected-type c)
+ ',expected-expected-type)))
+ (:no-error (&rest vals) (error "~S returned values: ~S" ',form vals)))))
+ (frob (make-tricky-defaults :fun 3) function)
+ (frob (make-tricky-defaults :num #'identity) fixnum))
+
+(let ((fun (compile nil '(lambda (&key (key (opaque-identity 3)))
+ (declare (optimize safety) (type integer key))
+ key))))
+ (assert (= (funcall fun) 3))
+ (assert (= (funcall fun :key 17) 17))
+ (handler-case (funcall fun :key t)
+ (type-error (c) (assert (eq (type-error-expected-type c) 'integer)))
+ (:no-error (&rest vals) (error "no error"))))
+
;;; success