Hi everybody,

First, let me thank you for all your hard work on SBCL!

I
have a question about SBCL optimizations for slot types in classes.
I've noticed that when using (with-slots ...) in a certain way, I seem
to get a lot of "unable to optimize" notices. Here's a toy example:First, let me thank you for all your hard work on SBCL!

(defclass A ()

((m_num

:type fixnum

:initform 2)))

(defmethod f ((a A))

(with-slots (m_num) a

(incf m_num)))

; note: unable to

; optimize

; due to type uncertainty:

; The first argument is a NUMBER, not a FLOAT.

;

; note: unable to

; associate +/+ of constants

; due to type uncertainty:

; The first argument is a NUMBER, not a RATIONAL.

;

; note: unable to

; associate +/- of constants

; due to type uncertainty:

; The first argument is a NUMBER, not a RATIONAL.

;

; note: forced to do GENERIC-+ (cost 10)

; unable to do inline fixnum arithmetic (cost 1) because:

; The first argument is a T, not a FIXNUM.

; The result is a (VALUES NUMBER &OPTIONAL), not a (VALUES FIXNUM &REST T).

; unable to do inline fixnum arithmetic (cost 2) because:

; The first argument is a T, not a FIXNUM.

; The result is a (VALUES NUMBER &OPTIONAL), not a (VALUES FIXNUM &REST T).

; etc.

Thanks so much!