From 7acdf15e27993655c9249f79d36fe2117843dbdf Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Tue, 17 Jul 2012 00:34:43 +0400 Subject: [PATCH] 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. --- src/code/error.lisp | 4 ++-- src/compiler/fndb.lisp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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)) -- 1.7.10.4