Don't use the expanded type if it's a protobuf enum
authorAlejandro R Sedeño <asedeno@google.com>
Sat, 15 Dec 2012 01:42:22 +0000 (20:42 -0500)
committerAlejandro R Sedeño <asedeno@google.com>
Mon, 17 Dec 2012 05:07:16 +0000 (00:07 -0500)
This fixes the unit test that broke in the previous commit

clos-transform.lisp

index ab504d8..82e37c4 100644 (file)
    whether or not to pack the field, and (optionally) a set of enum values."
   (let* ((type (if type-filter (funcall type-filter type) type))
          (list-of-list-of (list-of-list-of))
+         (type-enum (when (and *protobuf* (symbolp type))
+                      (find-enum *protobuf* type)))
          (expanded-type (type-expand type)))
     (cond
       ((listp type)
                    (lisp-type-to-protobuf-type (first tail))
                  (values type class (packed-type-p class)))
                (lisp-type-to-protobuf-type type))))))
-      ((not (equal type expanded-type))
+      ((not (or type-enum (equal type expanded-type)))
        (clos-type-to-protobuf-type expanded-type))
       (t
        (lisp-type-to-protobuf-type type)))))