LightTable / Clojure

Light Table Clojure language plugin
MIT License
99 stars 51 forks source link

Evaling a set form throws a "... java.lang.Long cannot be cast to java.lang.Integer" exception #71

Closed kenny-evitt closed 8 years ago

kenny-evitt commented 8 years ago

I was reviewing LightTable/ClojureInstarepl#7 when I discovered this. I'm running version 0.8.1 of LT and version 0.3.1 of the Clojure plugin.

Both of the following forms throw the same exception when evaled separately, or together:

#{1 2 3 4}
#{"a" "b" "c"}

Full exception stack trace:

java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
       Compiler.java:6599 clojure.lang.Compiler.eval
       Compiler.java:6582 clojure.lang.Compiler.eval
            core.clj:2852 clojure.core/eval
              eval.clj:76 lighttable.nrepl.eval/->result
             AFn.java:163 clojure.lang.AFn.applyToHelper
             AFn.java:151 clojure.lang.AFn.applyTo
             core.clj:619 clojure.core/apply
            core.clj:2396 clojure.core/partial[fn]
          RestFn.java:408 clojure.lang.RestFn.invoke
            core.clj:2485 clojure.core/map[fn]
          LazySeq.java:42 clojure.lang.LazySeq.sval
          LazySeq.java:60 clojure.lang.LazySeq.seq
              RT.java:484 clojure.lang.RT.seq
             core.clj:133 clojure.core/seq
            core.clj:2523 clojure.core/filter[fn]
          LazySeq.java:42 clojure.lang.LazySeq.sval
          LazySeq.java:60 clojure.lang.LazySeq.seq
              RT.java:484 clojure.lang.RT.seq
             core.clj:133 clojure.core/seq
            core.clj:2780 clojure.core/dorun
            core.clj:2796 clojure.core/doall
             eval.clj:125 lighttable.nrepl.eval/eval-clj
          RestFn.java:442 clojure.lang.RestFn.invoke
             eval.clj:191 lighttable.nrepl.eval/eval1706[fn]
             AFn.java:159 clojure.lang.AFn.applyToHelper
             AFn.java:151 clojure.lang.AFn.applyTo
             core.clj:617 clojure.core/apply
            core.clj:1788 clojure.core/with-bindings*
          RestFn.java:425 clojure.lang.RestFn.invoke
             eval.clj:176 lighttable.nrepl.eval/eval1706[fn]
             eval.clj:175 lighttable.nrepl.eval/eval1706[fn]
         MultiFn.java:227 clojure.lang.MultiFn.invoke
              core.clj:97 lighttable.nrepl.core/queued[fn]
            core.clj:2330 clojure.core/comp[fn]
interruptible_eval.clj:159 clojure.tools.nrepl.middleware.interruptible-eval/run-next[fn]
              AFn.java:24 clojure.lang.AFn.run
ThreadPoolExecutor.java:1142 java.util.concurrent.ThreadPoolExecutor.runWorker
ThreadPoolExecutor.java:617 java.util.concurrent.ThreadPoolExecutor$Worker.run
          Thread.java:745 java.lang.Thread.run
cldwalker commented 8 years ago

On osx 10.10 I can't recreate this. Could you provide more specifics? I eval'ed with Cmd/Ctrl-enter and with this example file:

(ns dev)

#{1 2 3 4}
#{"a" "b" "c"}

My connection is a normal connection started by evaling the top form. Using clojure 1.7.0

kenny-evitt commented 8 years ago

I couldn't reproduce this on my Windows 7 computer [note to myself – T] just now either either in an InstaREPL tab. I was able to reproduce it in an existing file for a Clojure project using Clojure 1.5.1. Let me see if I can create a minimal project to share.

kenny-evitt commented 8 years ago

Also, given the time of my original comments, I am pretty sure I was using my Mac (newest OS X version). I believe I upgraded LT in LT, instead of building a new version. I'll confirm whether I can reproduce this again on that computer anyways.

kenny-evitt commented 8 years ago

I created a new Leiningen project, using the default template, i.e. by running lein new project-name. It's using Clojure 1.7.0. I cannot reproduce this with the generated core.clj file.

I was however able to reproduce it after I changed the Clojure version in project.clj to 1.5.1.

Clojure 1.6.0 works, i.e. I can NOT reproduce this with that version.

Given that we're not supporting versions of Clojure earlier than 1.7.0, and that no one (including me) cares about fixing this, I'm closing this.

Sorry for the trouble! In the future, I'll try bumping the version of Clojure I'm using in my projects before creating new issues for apparent bugs.

cldwalker commented 8 years ago

Thanks for following through and agree that Clojure 1.5.1 is out of scope

paulMihei commented 8 years ago

Yes, you're right! The issue is about the version: image This happens to me when I create a new file and save it as .clj.

But with a new Leiningen project the version is 1.7.0.

Which version do you have if you just create a new .clj file? I just executed a freshly downloaded LightTable on a windows 7 virtual machine. With a new .clj file I still have image

Is this all right?

kenny-evitt commented 8 years ago

@paulMihei If you create a new Clojure file, the version of Clojure should be the version your project uses. If you make a new Clojure file that's not in a project, it looks like the LightTable-REPL connection gives you Clojure version 1.5.1. We should fix that.

kenny-evitt commented 8 years ago

@cldwalker @rundis Maybe the version of Clojure for a Clojure file for the LightTable-REPL connection (at least without a project) is 1.5.1 because the Clojure plugin project itself still depends on 1.5.1?

pjago commented 8 years ago

How can I effectively update a plugin from Light Table? I see many plugins that I have installed by the manager don't appear under LightTable\resources\app\plugins. I also tried changing the Clojure plugin on the same folder to 1.8.0 but still, I got 1.5.1. https://github.com/LightTable/ClojureInstarepl/issues/19