-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context not set for PersistentList #162
Comments
It is very strange, because we have the same thing in tests and it works as expected :S |
Hi Same here. Very small project just for testing cats and promesa: (defproject slack-wb "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[http-kit "2.1.18"]
[cheshire "5.6.1"]
[funcool/promesa "1.1.1"]
[funcool/cats "1.2.1"]]) The offending function (ns slack-wb.sandbox
(:require [org.httpkit.client :as http]
[cheshire.core :refer :all]
[promesa.core :as p]
[cats.core :as m]
[cats.builtin]
[cats.monad.maybe :as maybe]
[cats.monad.either :as either]))
(defn ee
[x]
(m/fmap inc '(1 2 3 (Integer/parseInt x))))
(defn -main
[& args]
(ee (first args))) Either from the repl or running the code from leiningen, the result is the same: $ lein run -m slack-wb.sandbox
Exception in thread "main" java.lang.IllegalArgumentException: No context is set and it can not be automatically resolved., compiling:(/private/var/folders/p2/22f9bht534b7d81ybhyyghf40000gn/T/form-init3677970153629996767.clj:1:125)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.main$load_script.invokeStatic(main.clj:275)
at clojure.main$init_opt.invokeStatic(main.clj:277)
at clojure.main$init_opt.invoke(main.clj:277)
at clojure.main$initialize.invokeStatic(main.clj:308)
at clojure.main$null_opt.invokeStatic(main.clj:342)
at clojure.main$null_opt.invoke(main.clj:339)
at clojure.main$main.invokeStatic(main.clj:421)
at clojure.main$main.doInvoke(main.clj:384)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.IllegalArgumentException: No context is set and it can not be automatically resolved.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at clojure.lang.Reflector.invokeConstructor(Reflector.java:180)
at cats.context$throw_ilegal_argument.invokeStatic(context.cljc:34)
at cats.context$throw_ilegal_argument.invoke(context.cljc:34)
at cats.context$get_current.invokeStatic(context.cljc:87)
at cats.context$get_current.invoke(context.cljc:66)
at cats.core$fmap.invokeStatic(core.cljc:129)
at cats.core$fmap.invoke(core.cljc:122)
at slack_wb.sandbox$ee.invokeStatic(sandbox.clj:23)
at slack_wb.sandbox$ee.invoke(sandbox.clj:21)
at slack_wb.sandbox$_main.invokeStatic(sandbox.clj:27)
at slack_wb.sandbox$_main.doInvoke(sandbox.clj:25)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.Var.invoke(Var.java:375)
at user$eval5.invokeStatic(form-init3677970153629996767.clj:1)
at user$eval5.invoke(form-init3677970153629996767.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.load(Compiler.java:7379)
... 14 more Just in case it helps, the java version is:
On MacOS X 10.10.5 HTH and thanks in advance Cristóbal |
Seems like the bug is fixed but is not yet released. In master it works as expected. Be bug consists that list does not have implemenation of Functor. |
In any case, your code will raise an other exception, because Use |
👍 You are definitely right. I put some code aside in order to make the issue reproducible by you guys and missed the implications of the quote. Thanks for your help and best regards |
I assume the following should work.
New project with Clojure 1.8.0 and cats 1.2.1:
throws:
I'm not sure why it doesn't though, as I see in cats.builtin that it should already be extended. If I do the same manually in my REPL then everything works as expected.
The text was updated successfully, but these errors were encountered: