Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#329 closed defect (fixed)

typep gives false negative for subclasses of standard-generic-function in some positions

Reported by: S11001001 Owned by: gb
Priority: minor Milestone:
Component: ANSI CL Compliance Version: trunk
Keywords: Cc:


Loading a file with userinit disabled in Version 1.2-r10579M-trunk (Linuxx8664) with the following forms:

(defclass my-generic-function () ()
  (:metaclass funcallable-standard-class))

(format t "In a toplevel form: ~S~%"
          (typep (make-instance 'my-generic-function) 'my-generic-function))

(let ()
  (format t "In a let: ~S~%"
          (typep (make-instance 'my-generic-function) 'my-generic-function)))

(funcall (compile nil '(lambda ()
                         (format t "In a compiled closure: ~S~%"
                                 (typep (make-instance 'my-generic-function)

Gives T, NIL, and NIL respectively, where I would expect all T.

As far as I can tell, this only happens for user-defined classes whose metaclass is funcallable-standard-class, whether or not subclassing standard-generic-function.

Change History (3)

comment:1 Changed 13 years ago by gb

  • Status changed from new to assigned

Thanks. I think that that's fixed in r10616.

(For anyone interested, this was a bug in a compiler-macro on TYPEP; TYPEP of GENERIC-FUNCTION and STANDARD-GENERIC-FUNCTION and FUNCALLABLE-STANDARD-OBJECT were handled in a different way, but user-defined subclasses of those classes ran into the bug.)

comment:2 Changed 13 years ago by S11001001

  • Resolution set to fixed
  • Status changed from assigned to closed

r10616 fixes this for Closer to MOP and cl-cont, where I originally discovered the issue. Thanks!

comment:3 Changed 13 years ago by rme

Just to state what may be obvious, this bug is not present in the 1.2 release branch.

Note: See TracTickets for help on using tickets.