       (let [match (->Match params data)]
         (reify Matcher
           (match [_ i max path]
-            (if (<= i max) (assoc-param match key (decode path i max true))))
+            (if (<= ^long i ^long max) (assoc-param match key (decode path i max true))))
           (view [_] [key [data]])
           (depth [_] 1)
           (length [_]))))

      (let [size (count path)]
        (reify Matcher
          (match [_ i max p]
            (if-not (< max (+ i size))
              (loop [j 0]
                (if (= j size)
                  (match matcher (+ i size) max p)
                  (if (= (get p (+ i j)) (get path j))
                    (recur (inc j)))))))
          (view [_] [path (view matcher)])
          (depth [_] (inc (depth matcher)))

  (let [bracket? (-> syntax (into-set) :bracket)
        colon? (-> syntax (into-set) :colon)
        -static (fn [from to] (if-not (= from to) [(subs s from to)]))
        -wild (fn [^long from to] [(->Wild (-keyword (subs s (inc from) to)))])
        -catch-all (fn [^long from to] [(->CatchAll (keyword (subs s (inc from) to)))])]
    (loop [ss nil, from 0, to 0]
      (if (= to (count s))
        (concat ss (-static from to))
