core-typed

2024-05-18T19:16:39.766119Z

For this function i'm getting an interesting warning: "WARNING: Local became bottom when checking case then". It doesn't give an error for that file just the warning. Can you explain why the type checker is giving me a warning?

(t/ann get-all-users [t/Str t/Int -> (t/Vec User)])
(defn get-all-users [sort-val page]
  (let [page (if (< page 1) 1 page)
        limit 20
        offset (* (dec page) limit)]

    (case sort-val
      ("sortval1" nil) (get-users page)

      "sortval2" (get-sortval2-users limit offset)

      "sortval3" (get-sortval3-users limit offset)

      "sortval4" (get-sortval4-users limit offset)

      [])))

2024-05-18T19:42:51.121499Z

It means that there's an unreachable case. Probably the nil case.

2024-05-18T20:06:06.401129Z

Oh because I have sort-val typed as a string thanks

👍 1