:undeclared-var warning.recur targets the function keeps it in the map fn, so recur takes the map as in
0.1.4 (1 row: no ClassCastException; 2+ rows: compiles).:double row in the compile-time check (cljs numbers are
doubles), so (scale {:x 1}) neither warns nor falls back to the map call.^{:closed true}); a key that is not a keyword
literal ({k 100}) skips the key checks and the rewrite.:advanced) builds only; dev builds keep the
shadow-cljs cache (before, every namespace defining a defn-typed recompiled on every build)
and compile plain calls.(defmeta 5 …), (defn-typed), an odd input map and two rows binding
one local are a finding naming the problem (the file's other findings stay) and a compile error.{:optional true} in
<name>-props, so an instrumented call may omit it.:referred call from another namespace gets neither the literal check nor the
rewrite.<key> <value> — <reason>: a part inside the value leads with its
path (at 1: should be a keyword); without a malli message, does not match <schema>.:or of the function's destructuring, taken
from the rows when the macro expands. with-defaults still runs for ^{:as row} functions,
and row-value (new) for a row whose defaults only the evaluated schema shows (a symbol as its
type, a [:map …] row with defaults inside). Results are unchanged: an explicit nil stays nil,
a default written as a call is evaluated once, at the def.<name>--positional (the rows as parameters, entry order); <name> destructures
and calls it.defn-typed.inline=true at compile time;
cljs: :optimizations :advanced), a call whose argument is a map literal of known keys holding
every required row compiles to the positional call, values evaluated in the literal's order.
clj covers every direct call (:inline); cljs covers calls through an alias, a qualified name or
inside the defining namespace (a macro of the same name), not a :referred call from another
namespace.WARNING defn-typed <file>:<line>: (f …) <findings> to
stderr and the call compiles to the map call.expand-call (the call-site expander), row-value.(defn-typed f {…} ->) with nothing after -> is a compile error naming the function ("no output
schema after ->"); the clj-kondo hook reports it too (before, the macro compiled it with a nil
output schema and the hook stayed silent).malli.clj-kondo/emit!, cljs via malli.clj-kondo/print-cljs!), and what is checked statically,
at runtime and in a release.defn-typed without -> reports "expected ->" and the rest of the file still lints
(before, clj-kondo printed "Can't parse " and dropped every other finding of that file).io.github.hyperfocusdisordered/defn-typed); library code unchanged since 0.1.1.build.clj (clojure -T:build jar | deploy), GitHub Actions CI (clj, cljs, clj-kondo).:default in the row type's own props, type first: :qty [:int {:min 1 :default 1}]
(malli's schema default). defn-typed marks such a row {:optional true} itself
(defaults-optional, nested maps included); with-defaults reads the type's props.:default in a row's entry props (key [{:default v} schema]) = compile error and clj-kondo
error naming the fix; entry props stay for {:optional true} without a default.defaulted-required-keys, defaulted-key-rule and malli-reasons' defaulted-key line;
malli-fns no longer returns :form. Added: schema-props, entry-default-paths,
entry-default-rule, defaults-optional.defn-typed + defmeta, extracted from a production Clojure/ClojureScript app.check-var, check-vars, check-ns, case-vars, registered-vars,
undefined-metas, forget-ns!, deftests!, test-ns!, test-var!, malli-reasons,
malli-fns, *trace-cases*, with-defaults; legacy tests.resources/clj-kondo.exports/io.github.hyperfocusdisordered/defn-typed/.Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |