marick / Midje

Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing
MIT License
1.69k stars 129 forks source link

Getting syntax error trying to `use` Midje? #492

Closed edenworky closed 9 months ago

edenworky commented 9 months ago

abstract

This happens both in test files doing (ns ...ns-name... (:use midje.sweet)) (and then lein midje) and in the repl doing (use 'midje.repl'), even in a newly generated project from lein new midje ...project-name.... When I try either, I get the following error printed:

Syntax error (IllegalArgumentException) compiling deftype* at (ordered/set.clj:12:1).
Must hint overloaded method: toArray

I couldn't find ordered/set.clj anywhere, and the only ordered/set.clj I know doesn't use deftype*. I'm still new to Clojure so I'm not sure if maybe I'm doing something stupid, I'm using clojure 1.11.0 (but trying 1.10.3 didn't make a discernible difference). Currently I can't run Midje. Any insight?

logs

CIDER log:

;; Connected to nREPL server - nrepl://localhost:37925
;; CIDER 1.13.0-snapshot (package: 1.13.0-snapshot), nREPL 1.0.0
;; Clojure 1.11.1, Java 11.0.22
;;     Docs: (doc function-name)
;;           (find-doc part-of-name)
;;   Source: (source function-name)
;;  Javadoc: (javadoc java-object-or-class)
;;     Exit: <C-c C-q>
;;  Results: Stored in vars *1, *2, *3, an exception in *e;
;; ======================================================================
;; If you’re new to CIDER it is highly recommended to go through its
;; user manual first. Type <M-x cider-view-manual> to view it.
;; In case you’re seeing any warnings you should consult the manual’s
;; "Troubleshooting" section.
;;
;; Here are a few tips to get you started:
;;
;; * Press <C-h m> to see a list of the keybindings available (this
;;   will work in every Emacs buffer)
;; * Press <,> to quickly invoke some REPL command
;; * Press <C-c C-z> to switch between the REPL and a Clojure file
;; * Press <M-.> to jump to the source of something (e.g. a var, a
;;   Java method)
;; * Press <C-c C-d C-d> to view the documentation for something (e.g.
;;   a var, a Java method)
;; * Print CIDER’s refcard and keep it close to your keyboard.
;;
;; CIDER is super customizable - try <M-x customize-group cider> to
;; get a feel for this. If you’re thirsty for knowledge you should try
;; <M-x cider-drink-a-sip>.
;;
;; If you think you’ve encountered a bug (or have some suggestions for
;; improvements) use <M-x cider-report-bug> to report it.
;;
;; Above all else - don’t panic! In case of an emergency - procure
;; some (hard) cider and enjoy it responsibly!
;;
;; You can remove this message with the <M-x cider-repl-clear-help-banner> command.
;; You can disable it from appearing on start by setting
;; ‘cider-repl-display-help-banner’ to nil.
;; ======================================================================
;;  Startup: /usr/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"1.0.0\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.9.1\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.9.1\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.44.0\"\] -- repl :headless :host localhost
user> (use 'midje.repl)
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.clojure.core, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.repl, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.config, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.emission.levels, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.util.pile, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.emission.api, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.emission.plugins.util, being replaced by: #'midje.clojure.core/any?
WARNING: cat already refers to: #'clojure.core/cat in namespace: net.cgrand.parsley.fold, being replaced by: #'net.cgrand.parsley.fold/cat
Syntax error (IllegalArgumentException) compiling deftype* at (ordered/set.clj:12:1).
Must hint overloaded method: toArray

Running lein midje:

lein midje
WARNING: any? already refers to: #'clojure.core/any? in namespace: leiningen.midje, being replaced by: #'leiningen.midje/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.clojure.core, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.config, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.emission.levels, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.util.pile, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.repl, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.emission.api, being replaced by: #'midje.clojure.core/any?
WARNING: any? already refers to: #'clojure.core/any? in namespace: midje.emission.plugins.util, being replaced by: #'midje.clojure.core/any?
WARNING: cat already refers to: #'clojure.core/cat in namespace: net.cgrand.parsley.fold, being replaced by: #'net.cgrand.parsley.fold/cat
Syntax error (IllegalArgumentException) compiling deftype* at (ordered/set.clj:12:1).
Must hint overloaded method: toArray

Full report at:
/tmp/clojure-13128338281462840880.edn
Subprocess failed

Compilation exited abnormally with code 1 at Fri Mar  1 19:48:21

The full report:

 {:clojure.main/message
 "Syntax error (IllegalArgumentException) compiling deftype* at (ordered/set.clj:12:1).\nMust hint overloaded method: toArray\n",
 :clojure.main/triage
 {:clojure.error/phase :compile-syntax-check,
  :clojure.error/line 12,
  :clojure.error/column 1,
  :clojure.error/source "set.clj",
  :clojure.error/symbol deftype*,
  :clojure.error/path "ordered/set.clj",
  :clojure.error/class java.lang.IllegalArgumentException,
  :clojure.error/cause "Must hint overloaded method: toArray"},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.Compiler$CompilerException,
    :message
    "Syntax error compiling deftype* at (ordered/set.clj:12:1).",
    :data
    {:clojure.error/phase :compile-syntax-check,
     :clojure.error/line 12,
     :clojure.error/column 1,
     :clojure.error/source "ordered/set.clj",
     :clojure.error/symbol deftype*},
    :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 7132]}
   {:type java.lang.IllegalArgumentException,
    :message "Must hint overloaded method: toArray",
    :at
    [clojure.lang.Compiler$NewInstanceMethod
     parse
     "Compiler.java"
     8514]}],
  :trace
  [[clojure.lang.Compiler$NewInstanceMethod parse "Compiler.java" 8514]
   [clojure.lang.Compiler$NewInstanceExpr build "Compiler.java" 8076]
   [clojure.lang.Compiler$NewInstanceExpr$DeftypeParser
    parse
    "Compiler.java"
    7952]
   [clojure.lang.Compiler analyzeSeq "Compiler.java" 7124]
   [clojure.lang.Compiler analyze "Compiler.java" 6806]
   [clojure.lang.Compiler analyze "Compiler.java" 6762]
   [clojure.lang.Compiler$BodyExpr$Parser parse "Compiler.java" 6135]
   [clojure.lang.Compiler$LetExpr$Parser parse "Compiler.java" 6453]
   [clojure.lang.Compiler analyzeSeq "Compiler.java" 7124]
   [clojure.lang.Compiler analyze "Compiler.java" 6806]
   [clojure.lang.Compiler analyze "Compiler.java" 6762]
   [clojure.lang.Compiler$BodyExpr$Parser parse "Compiler.java" 6137]
   [clojure.lang.Compiler$FnMethod parse "Compiler.java" 5479]
   [clojure.lang.Compiler$FnExpr parse "Compiler.java" 4041]
   [clojure.lang.Compiler analyzeSeq "Compiler.java" 7122]
   [clojure.lang.Compiler analyze "Compiler.java" 6806]
   [clojure.lang.Compiler eval "Compiler.java" 7191]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.RT loadResourceScript "RT.java" 381]
   [clojure.lang.RT loadResourceScript "RT.java" 372]
   [clojure.lang.RT load "RT.java" 459]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "RestFn.java" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.core$require doInvoke "core.clj" 6038]
   [clojure.lang.RestFn invoke "RestFn.java" 551]
   [gui.diff$eval1358$loading__6789__auto____1359 invoke "diff.clj" 1]
   [gui.diff$eval1358 invokeStatic "diff.clj" 1]
   [gui.diff$eval1358 invoke "diff.clj" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler eval "Compiler.java" 7183]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.RT loadResourceScript "RT.java" 381]
   [clojure.lang.RT loadResourceScript "RT.java" 372]
   [clojure.lang.RT load "RT.java" 459]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "RestFn.java" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.core$require doInvoke "core.clj" 6038]
   [clojure.lang.RestFn invoke "RestFn.java" 551]
   [midje.emission.plugins.util$eval1352$loading__6789__auto____1353
    invoke
    "util.clj"
    1]
   [midje.emission.plugins.util$eval1352 invokeStatic "util.clj" 1]
   [midje.emission.plugins.util$eval1352 invoke "util.clj" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler eval "Compiler.java" 7183]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.RT loadResourceScript "RT.java" 381]
   [clojure.lang.RT loadResourceScript "RT.java" 372]
   [clojure.lang.RT load "RT.java" 459]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "RestFn.java" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.core$require doInvoke "core.clj" 6038]
   [clojure.lang.RestFn invoke "RestFn.java" 551]
   [midje.emission.plugins.default$eval1234$loading__6789__auto____1235
    invoke
    "default.clj"
    1]
   [midje.emission.plugins.default$eval1234
    invokeStatic
    "default.clj"
    1]
   [midje.emission.plugins.default$eval1234 invoke "default.clj" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler eval "Compiler.java" 7183]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.RT loadResourceScript "RT.java" 381]
   [clojure.lang.RT loadResourceScript "RT.java" 372]
   [clojure.lang.RT load "RT.java" 459]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "RestFn.java" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.core$require doInvoke "core.clj" 6038]
   [clojure.lang.RestFn invoke "RestFn.java" 421]
   [midje.emission.api$load_plugin invokeStatic "api.clj" 25]
   [midje.emission.api$load_plugin invoke "api.clj" 23]
   [clojure.lang.Var invoke "Var.java" 384]
   [midje.Bootstrap$bootstrap invokeStatic "Bootstrap.clj" 16]
   [midje.Bootstrap$bootstrap invoke "Bootstrap.clj" 5]
   [midje.repl$eval1024 invokeStatic "sweet.clj" 2]
   [midje.repl$eval1024 invoke "sweet.clj" 2]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.RT loadResourceScript "RT.java" 381]
   [clojure.lang.RT loadResourceScript "RT.java" 372]
   [clojure.lang.RT load "RT.java" 459]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "RestFn.java" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.core$require doInvoke "core.clj" 6038]
   [clojure.lang.RestFn invoke "RestFn.java" 2088]
   [midje.repl$eval1002$loading__6789__auto____1003
    invoke
    "repl.clj"
    1]
   [midje.repl$eval1002 invokeStatic "repl.clj" 1]
   [midje.repl$eval1002 invoke "repl.clj" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler eval "Compiler.java" 7183]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.RT loadResourceScript "RT.java" 381]
   [clojure.lang.RT loadResourceScript "RT.java" 372]
   [clojure.lang.RT load "RT.java" 459]
   [clojure.lang.RT load "RT.java" 424]
   [clojure.core$load$fn__6908 invoke "core.clj" 6161]
   [clojure.core$load invokeStatic "core.clj" 6160]
   [clojure.core$load doInvoke "core.clj" 6144]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5933]
   [clojure.core$load_one invoke "core.clj" 5928]
   [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
   [clojure.core$load_lib invokeStatic "core.clj" 5974]
   [clojure.core$load_lib doInvoke "core.clj" 5953]
   [clojure.lang.RestFn applyTo "RestFn.java" 142]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$load_libs invokeStatic "core.clj" 6016]
   [clojure.core$load_libs doInvoke "core.clj" 6000]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 669]
   [clojure.core$require invokeStatic "core.clj" 6038]
   [clojure.core$require doInvoke "core.clj" 6038]
   [clojure.lang.RestFn invoke "RestFn.java" 408]
   [user$eval996 invokeStatic "form-init17578626467537691482.clj" 1]
   [user$eval996 invoke "form-init17578626467537691482.clj" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler eval "Compiler.java" 7184]
   [clojure.lang.Compiler eval "Compiler.java" 7183]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.Compiler loadFile "Compiler.java" 7591]
   [clojure.main$load_script invokeStatic "main.clj" 475]
   [clojure.main$init_opt invokeStatic "main.clj" 477]
   [clojure.main$init_opt invoke "main.clj" 477]
   [clojure.main$initialize invokeStatic "main.clj" 508]
   [clojure.main$null_opt invokeStatic "main.clj" 542]
   [clojure.main$null_opt invoke "main.clj" 539]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "Must hint overloaded method: toArray",
  :phase :compile-syntax-check}}
edenworky commented 9 months ago

Sorry, I was using an old version of Midje