DECLAIM does not seem to respect user defined declarations

Bug #2008997 reported by Shubhamkar Ayare
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

Consider a user defined declaration FOO:

    (defpackage cl-cltl2
      (:use :cl :sb-cltl2))

    (in-package :cl-cltl2)

    (define-declaration foo (info fn-name)
      (print :called)
      (values :function
              (list (list fn-name 'foo info))))

Then, DECLAIM-ing FOO has no effect on the value returned by FUNCTION-INFORMATION:

    (declaim (foo hello fn))
    (function-information 'fn) ;=> NIL NIL NIL

DECLAIM does work as expected on the pre-provided declarations such as TYPE or FTYPE.
Things also work as expected when DECLARE is used:

    (defmacro env-info (fn-name &environment env)
      `(quote ,(multiple-value-list (function-information fn-name env))))
    (locally (declare (foo hello fn))
      (env-info fn))
    ;=> (NIL NIL ((FOO FOO HELLO FN)))

I'm using SBCL 2.3.1.

Tags: sb-cltl2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.