From: Stas Boukarev Date: Mon, 16 Jul 2012 20:34:43 +0000 (+0400) Subject: Declare types for sb-kernel:coerce-to-condition. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=7acdf15e27993655c9249f79d36fe2117843dbdf;p=sbcl.git Declare types for sb-kernel:coerce-to-condition. Add (defknown coerce-to-condition ((or condition symbol string function) list type-specifier symbol) condition (explicit-check)) Which helps to remove optimization notes in some cases with restart-case. Fixes lp#1025416. --- diff --git a/src/code/error.lisp b/src/code/error.lisp index e701982..9086a94 100644 --- a/src/code/error.lisp +++ b/src/code/error.lisp @@ -51,10 +51,10 @@ (t (error 'simple-type-error :datum datum - :expected-type '(or symbol string) + :expected-type '(or symbol string function) :format-control "Condition designator ~s is not of type ~s." :format-arguments (list datum - '(or symbol string)))))) + '(or symbol string function)))))) (define-condition layout-invalid (type-error) () diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 8fede70..ac471cf 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -1589,6 +1589,11 @@ ()) (defknown style-warn (t &rest t) null ()) +(defknown coerce-to-condition ((or condition symbol string function) + list type-specifier symbol) + condition + (explicit-check)) + (defknown sc-number-or-lose (symbol) sc-number (foldable))