                                   has-y false]
                              (let [first-field (first curr-fields)
                                    rest-fields (rest curr-fields)]
-                               (if (not (empty curr-fields))
+                               (if (seq curr-fields)
                                  (cond
                                    (= (::sp/channel first-field) ::sp/x)
                                    (recur rest-fields

                               (if (not (empty curr-fields))
                                 (if (not= (::sp/channel first-field) ::sp/?)
                                   (if (not (sp/is-spatial-channel? (::sp/channel first-field)))
                                     (if (sp/is-channel-enumerated? spec)
                                       (if (and
                                             (> non-positional-channel-count 1)
                                             (has-enumerated-non-positional-channel))
                                         (recur rest-fields (+ non-positional-channel-count 1) true (and result false))
                                         (recur rest-fields (+ non-positional-channel-count 1) true (and result true)))
                                       (recur rest-fields (+ non-positional-channel-count 1) false (and result true)))
                                     (recur rest-fields non-positional-channel-count false (and result true)))
                                   (recur rest-fields non-positional-channel-count false (and result true)))
                                 result
                                 )))))])



(defprotocol Satisfiable
  (satisfied? [self y]))

(defrecord Constraint
  [name description properties strict satisfy-fn]
  Satisfiable
  (satisfied? [self y]
    (satisfy-fn y)))

(def field-constraints [(->Constraint
                          "aggregate-op-supported-by-type"
