From 96d51a55a9205478c0883e885d5fa17cb4012d29 Mon Sep 17 00:00:00 2001 Message-Id: <96d51a55a9205478c0883e885d5fa17cb4012d29.1715241370.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] src/c-types-class-impl.lisp (find-sod-class): Improve error reporting. Organization: Straylight/Edgeware From: Mark Wooding The built-in simple type names are now properly baked in, in the `*simple-type-map*' hash table, rather than being exported by the `builtin' module, so check there before reporting a type as `unknown'. --- src/c-types-class-impl.lisp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/c-types-class-impl.lisp b/src/c-types-class-impl.lisp index 1f43c60..2908d75 100644 --- a/src/c-types-class-impl.lisp +++ b/src/c-types-class-impl.lisp @@ -128,9 +128,13 @@ (define-c-type-syntax class (name &rest quals) (export 'find-sod-class) (defun find-sod-class (name) "Return the `sod-class' object with the given NAME." - (aif (find-class-type name) - (or (c-type-class it) (error "Class `~A' is incomplete" name)) - (error "Type `~A' not known" name))) + (acond ((find-class-type name) + (or (c-type-class it) + (error "Class `~A' is incomplete" name))) + ((find-simple-c-type name) + (error "Type `~A' is not a class" name)) + (t + (error "Type `~A' not known" name)))) (export 'record-sod-class) (defun record-sod-class (class) -- [mdw]