From 1645e4335e58ef3a8f1cafb1834e93760d80d9ae Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] src/*.lisp: Fix declared slot types. 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 | 2 +- src/class-layout-proto.lisp | 2 +- src/classes.lisp | 2 +- src/module-impl.lisp | 3 ++- src/parser/streams-impl.lisp | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/c-types-parse.lisp b/src/c-types-parse.lisp index 53fc811..0a6b5ab 100644 --- a/src/c-types-parse.lisp +++ b/src/c-types-parse.lisp @@ -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)) diff --git a/src/class-layout-proto.lisp b/src/class-layout-proto.lisp index 0803b18..d34bf8b 100644 --- a/src/class-layout-proto.lisp +++ b/src/class-layout-proto.lisp @@ -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)) diff --git a/src/classes.lisp b/src/classes.lisp index 118b09b..da18f5a 100644 --- a/src/classes.lisp +++ b/src/classes.lisp @@ -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. diff --git a/src/module-impl.lisp b/src/module-impl.lisp index 206b5e6..ba04397 100644 --- a/src/module-impl.lisp +++ b/src/module-impl.lisp @@ -199,7 +199,8 @@ (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 diff --git a/src/parser/streams-impl.lisp b/src/parser/streams-impl.lisp index 33015a0..378f9a8 100644 --- a/src/parser/streams-impl.lisp +++ b/src/parser/streams-impl.lisp @@ -214,7 +214,7 @@ 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 -- 2.11.0