Closed escherize closed 1 year ago
Here's the repl:
*ns* ;; => #namespace[malli.experimental] (defn f [& xs] 1) ;; => #'malli.experimental/f (f 3) ;; => 1 (defn ^:malli/always g [& xs] 1) ;; throws => ;; 2. Unhandled clojure.lang.Compiler$CompilerException ;; Error compiling src/malli/experimental.cljc at (82:1) ;; #:clojure.error{:phase :compile-syntax-check, ;; :line 82, ;; :column 1, ;; :source "/Users/bcm/dv/mmalli/src/malli/experimental.cljc"} ;; Compiler.java: 6825 clojure.lang.Compiler/analyze ;; Compiler.java: 6762 clojure.lang.Compiler/analyze ;; Compiler.java: 3900 clojure.lang.Compiler$InvokeExpr/parse ;; Compiler.java: 7126 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 6762 clojure.lang.Compiler/analyze ;; Compiler.java: 6137 clojure.lang.Compiler$BodyExpr$Parser/parse ;; Compiler.java: 5479 clojure.lang.Compiler$FnMethod/parse ;; Compiler.java: 4041 clojure.lang.Compiler$FnExpr/parse ;; Compiler.java: 7122 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 7112 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 38 clojure.lang.Compiler/access$300 ;; Compiler.java: 596 clojure.lang.Compiler$DefExpr$Parser/parse ;; Compiler.java: 7124 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 7112 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 38 clojure.lang.Compiler/access$300 ;; Compiler.java: 6401 clojure.lang.Compiler$LetExpr$Parser/parse ;; Compiler.java: 7124 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 6762 clojure.lang.Compiler/analyze ;; Compiler.java: 6137 clojure.lang.Compiler$BodyExpr$Parser/parse ;; Compiler.java: 5479 clojure.lang.Compiler$FnMethod/parse ;; Compiler.java: 4041 clojure.lang.Compiler$FnExpr/parse ;; Compiler.java: 7122 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 7191 clojure.lang.Compiler/eval ;; Compiler.java: 7149 clojure.lang.Compiler/eval ;; core.clj: 3215 clojure.core/eval ;; core.clj: 3211 clojure.core/eval ;; interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn/fn ;; AFn.java: 152 clojure.lang.AFn/applyToHelper ;; AFn.java: 144 clojure.lang.AFn/applyTo ;; core.clj: 667 clojure.core/apply ;; core.clj: 1990 clojure.core/with-bindings* ;; core.clj: 1990 clojure.core/with-bindings* ;; RestFn.java: 425 clojure.lang.RestFn/invoke ;; interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn ;; main.clj: 437 clojure.main/repl/read-eval-print/fn ;; main.clj: 437 clojure.main/repl/read-eval-print ;; main.clj: 458 clojure.main/repl/fn ;; main.clj: 458 clojure.main/repl ;; main.clj: 368 clojure.main/repl ;; RestFn.java: 1523 clojure.lang.RestFn/invoke ;; interruptible_eval.clj: 84 nrepl.middleware.interruptible-eval/evaluate ;; interruptible_eval.clj: 56 nrepl.middleware.interruptible-eval/evaluate ;; interruptible_eval.clj: 152 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn ;; AFn.java: 22 clojure.lang.AFn/run ;; session.clj: 218 nrepl.middleware.session/session-exec/main-loop/fn ;; session.clj: 217 nrepl.middleware.session/session-exec/main-loop ;; AFn.java: 22 clojure.lang.AFn/run ;; Thread.java: 829 java.lang.Thread/run ;; ;; 1. Caused by java.lang.RuntimeException ;; Unable to resolve symbol: & in this context ;; ;; Util.java: 221 clojure.lang.Util/runtimeException ;; Compiler.java: 7431 clojure.lang.Compiler/resolveIn ;; Compiler.java: 7375 clojure.lang.Compiler/resolve ;; Compiler.java: 7336 clojure.lang.Compiler/analyzeSymbol ;; Compiler.java: 6785 clojure.lang.Compiler/analyze ;; Compiler.java: 6762 clojure.lang.Compiler/analyze ;; Compiler.java: 3900 clojure.lang.Compiler$InvokeExpr/parse ;; Compiler.java: 7126 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 6762 clojure.lang.Compiler/analyze ;; Compiler.java: 6137 clojure.lang.Compiler$BodyExpr$Parser/parse ;; Compiler.java: 5479 clojure.lang.Compiler$FnMethod/parse ;; Compiler.java: 4041 clojure.lang.Compiler$FnExpr/parse ;; Compiler.java: 7122 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 7112 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 38 clojure.lang.Compiler/access$300 ;; Compiler.java: 596 clojure.lang.Compiler$DefExpr$Parser/parse ;; Compiler.java: 7124 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 7112 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 38 clojure.lang.Compiler/access$300 ;; Compiler.java: 6401 clojure.lang.Compiler$LetExpr$Parser/parse ;; Compiler.java: 7124 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 6762 clojure.lang.Compiler/analyze ;; Compiler.java: 6137 clojure.lang.Compiler$BodyExpr$Parser/parse ;; Compiler.java: 5479 clojure.lang.Compiler$FnMethod/parse ;; Compiler.java: 4041 clojure.lang.Compiler$FnExpr/parse ;; Compiler.java: 7122 clojure.lang.Compiler/analyzeSeq ;; Compiler.java: 6806 clojure.lang.Compiler/analyze ;; Compiler.java: 7191 clojure.lang.Compiler/eval ;; Compiler.java: 7149 clojure.lang.Compiler/eval ;; core.clj: 3215 clojure.core/eval ;; core.clj: 3211 clojure.core/eval ;; interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn/fn ;; AFn.java: 152 clojure.lang.AFn/applyToHelper ;; AFn.java: 144 clojure.lang.AFn/applyTo ;; core.clj: 667 clojure.core/apply ;; core.clj: 1990 clojure.core/with-bindings* ;; core.clj: 1990 clojure.core/with-bindings* ;; RestFn.java: 425 clojure.lang.RestFn/invoke ;; interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn ;; main.clj: 437 clojure.main/repl/read-eval-print/fn ;; main.clj: 437 clojure.main/repl/read-eval-print ;; main.clj: 458 clojure.main/repl/fn ;; main.clj: 458 clojure.main/repl ;; main.clj: 368 clojure.main/repl ;; RestFn.java: 1523 clojure.lang.RestFn/invoke ;; interruptible_eval.clj: 84 nrepl.middleware.interruptible-eval/evaluate ;; interruptible_eval.clj: 56 nrepl.middleware.interruptible-eval/evaluate ;; interruptible_eval.clj: 152 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn ;; AFn.java: 22 clojure.lang.AFn/run ;; session.clj: 218 nrepl.middleware.session/session-exec/main-loop/fn ;; session.clj: 217 nrepl.middleware.session/session-exec/main-loop ;; AFn.java: 22 clojure.lang.AFn/run ;; Thread.java: 829 java.lang.Thread/run
macro expansion of g:
g
(let* [g-instrumented11819 (m/-instrument {:schema [:=> [:cat [:* :any]] :any]} (fn* g-instrumented11819 ([& xs] nil 1))) defn__11615__auto__ (def g (fn* ([& xs] nil (g-instrumented11819 & xs))))] (do (m/-register-function-schema! 'malli.experimental 'g [:=> [:cat [:* :any]] :any] #:malli{:always true}) 'g) defn__11615__auto__)
Oof, thanks, I'll look into that! The problem is the generated call (g-instrumended & xs).
(g-instrumended & xs)
Here's the repl:
macro expansion of
g
: