src/c-types-class-impl.lisp (find-sod-class): Improve error reporting.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Jun 2018 18:58:28 +0000 (19:58 +0100)
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

index 1f43c60..2908d75 100644 (file)
 (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)