src/*.lisp: Fix declared slot types.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 29 May 2016 13:27:39 +0000 (14:27 +0100)
SBCL doesn't seem too bothered about type mismatches in slot values, but
CMUCL kicks up a fuss.  These declared types were too strict, either
because of inadequate thinking or because the declarations had become
stale.

src/c-types-parse.lisp
src/class-layout-proto.lisp
src/classes.lisp
src/module-impl.lisp
src/parser/streams-impl.lisp

index 53fc811..0a6b5ab 100644 (file)
@@ -70,7 +70,7 @@
   ;; accessor functions later.
   ((label :type keyword :initarg :label :reader ds-label)
    (name :type string :initarg :name :reader ds-name)
-   (kind :type (member type sign size qualifier)
+   (kind :type (member type complexity sign size qualifier)
         :initarg :kind :reader ds-kind)
    (taggedp :type boolean :initarg :taggedp
            :initform nil :reader ds-taggedp))
index 0803b18..d34bf8b 100644 (file)
@@ -31,7 +31,7 @@
 (export '(effective-slot effective-slot-class
          effective-slot-direct-slot effective-slot-initializer))
 (defclass effective-slot ()
-  ((%class :initarg :class :type sod-slot :reader effective-slot-class)
+  ((%class :initarg :class :type sod-class :reader effective-slot-class)
    (slot :initarg :slot :type sod-slot :reader effective-slot-direct-slot)
    (initializer :initarg :initializer :type (or sod-initializer null)
                :reader effective-slot-initializer))
index 118b09b..da18f5a 100644 (file)
@@ -88,7 +88,7 @@
    (effective-methods :type list :reader sod-class-effective-methods)
    (vtables :type list :reader sod-class-vtables)
 
-   (state :initform nil :type (member nil :finalized broken)
+   (state :initform nil :type (member nil :finalized :broken)
          :reader sod-class-state))
   (:documentation
    "Classes describe the layout and behaviour of objects.
index 206b5e6..ba04397 100644 (file)
 (export '(code-fragment-item code-fragment code-fragment-reason
          code-fragment-name code-fragment-constraints))
 (defclass code-fragment-item ()
-  ((fragment :initarg :fragment :type c-fragment :reader code-fragment)
+  ((fragment :initarg :fragment :type (or string c-fragment)
+            :reader code-fragment)
    (reason :initarg :reason :type keyword :reader code-fragment-reason)
    (name :initarg :name :type t :reader code-fragment-name)
    (constraints :initarg :constraints :type list
index 33015a0..378f9a8 100644 (file)
          position-aware-stream-line position-aware-stream-column))
 (defclass position-aware-stream (proxy-stream)
   ((file :initarg :file :initform nil
-        :type pathname :accessor position-aware-stream-file)
+        :type (or pathname null) :accessor position-aware-stream-file)
    (line :initarg :line :initform 1
         :type fixnum :accessor position-aware-stream-line)
    (column :initarg :column :initform 0