From: stassats <sta...@us...> - 2015-08-05 15:38:39
|
The branch "master" has been updated in SBCL: via 25f56cfde904ac640d7c1422cbb3d265c4b7d614 (commit) from 7286e2ea5daeba48d4cfe74479aca81b88587855 (commit) - Log ----------------------------------------------------------------- commit 25f56cfde904ac640d7c1422cbb3d265c4b7d614 Author: Stas Boukarev <sta...@gm...> Date: Wed Aug 5 18:28:38 2015 +0300 defstruct: better handling of type conflicts in slot types. DEFSTRUCT canonicalizes slot types for prettier expansion, but when the types conflict the result is NIL, use the original types in such cases. --- src/code/defstruct.lisp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index 56ee245..f0d27aa 100644 --- a/src/code/defstruct.lisp +++ b/src/code/defstruct.lisp @@ -1455,9 +1455,11 @@ or they must be declared locally notinline at each call site.~@:>") (let* ((name (dsd-name slot)) (dum (copy-symbol name)) (keyword (keywordicate name)) + (specfied-type `(and ,int-type ,(dsd-type slot))) ;; Canonicalize the type for a prettier macro-expansion - (type (type-specifier - (specifier-type `(and ,int-type ,(dsd-type slot)))))) + ;; but leave it as is if there is a conflict. + (type (or (type-specifier (specifier-type specfied-type)) + specfied-type))) (arglist `((,keyword ,dum) ,(dsd-default slot))) (vals dum) ;; KLUDGE: we need a separate type declaration for for ----------------------------------------------------------------------- hooks/post-receive -- SBCL |