core-typed

J 2022-07-03T16:22:42.931939Z

Hi! It’s normal that typedclojure don’t throw error in this code:

(def Pokemon
  [:map
    [:pokemon/name :string]
    [:pokemon/level :int]])

(m/=> display-pokemon [:=> [:cat Pokemon] :string])
(defn display-pokemon [pokemon]
  (format "%s is at level %s" (:foo pokemon) (:baz pokemon)))
foo and baz are not in the pokemon definition. I don’t know if it’s possible to do this kind of check.

emccue 2022-07-03T18:12:00.571459Z

So the malli schema there is "open" - meaning you are allowed to have keys that are not in there

emccue 2022-07-03T18:12:18.490659Z

and even if you made it closed, you would then just know that the lookup would give nil

J 2022-07-03T18:31:04.405639Z

Even if the map is closed, there is no error.

2022-07-12T01:26:13.709379Z

Yes this is normal. (:foo pokemon) should be inferred as nil.