| Paste number 25320: | the cases |
| Pasted by: | jsnell |
| When: | 2 years, 9 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+JJC |
| Channel: | #lisp |
| Paste contents: |
(declaim (optimize safety))
(defclass a () ((slot1 :initform 0.0 :type float :accessor slot1-of)))
(defclass b (a) ((slot1 :initform 0.0 :type single-float)))
(defmethod inheritance-test ((a a))
(setf (slot-value a 'slot1) 1d0))
(inheritance-test (make-instance 'a))
;; Should this cause a type-error?
(inheritance-test (make-instance 'b))
(defmethod inheritance-test2 ((a a))
(setf (slot1-of a) 1d0))
(inheritance-test2 (make-instance 'a))
;; Should this cause a type-error?
(inheritance-test2 (make-instance 'b))
This paste has no annotations.