mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 23:32:17 -08:00
cmp: expand-typep: fix broken (complex type) expansion
This expansion did not account for the object not being a number. In that case
REALPART errored in the compiled code. Example:
(typep *package* '(complex float))
This commit is contained in:
parent
4ec4187427
commit
592a2cca17
1 changed files with 5 additions and 4 deletions
|
|
@ -87,9 +87,9 @@
|
|||
type
|
||||
(first type))
|
||||
'SI::DEFTYPE-DEFINITION))
|
||||
(expand-typep form object `',(funcall function (if (atom type)
|
||||
nil
|
||||
(rest type)))
|
||||
(expand-typep form object `(quote ,(funcall function (if (atom type)
|
||||
nil
|
||||
(rest type))))
|
||||
env))
|
||||
;;
|
||||
;; There exists a function which checks for this type?
|
||||
|
|
@ -162,7 +162,8 @@
|
|||
;; Compound COMPLEX types.
|
||||
((and (eq first 'COMPLEX)
|
||||
(= (list-length type) 2))
|
||||
`(and (typep (realpart ,object) ',(second type))
|
||||
`(and (complexp ,object)
|
||||
(typep (realpart ,object) ',(second type))
|
||||
(typep (imagpart ,object) ',(second type))))
|
||||
;;
|
||||
;; (SATISFIES predicate)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue