Engelberg / instaparse

Eclipse Public License 1.0
2.74k stars 149 forks source link

'lein check' fails with odd error message #85

Open jafingerhut opened 10 years ago

jafingerhut commented 10 years ago

I tried with Leiningen 2.5.0, and get the same behavior for Clojure 1.5.1, 1.6.0, and 1.7.0-alpha3. I haven't tracked down the cause of this yet, but wanted to create an issue for it in case someone figures it out. Perhaps the type hints for AutoFlattenSeq should have fully qualified names?

% lein with-profile +1.7 do clean, check Compiling namespace instaparse.abnf Compiling namespace instaparse.auto-flatten-seq Compiling namespace instaparse.cfg Compiling namespace instaparse.clone Compiling namespace instaparse.combinators Compiling namespace instaparse.combinators-source Compiling namespace instaparse.core Reflection warning, rhizome/viz.clj:72:6 - call to static method write on javax.imageio.ImageIO can't be resolved (argument types: unknown, unknown, java.io.File). Exception in thread "main" java.lang.ClassCastException: instaparse.auto_flatten_seq.AutoFlattenSeq cannot be cast to instaparse.auto_flatten_seq.AutoFlattenSeq, compiling:(core.clj:248:14) at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3602)

[... many stack trace lines elided here ... ]

Caused by: java.lang.ClassCastException: instaparse.auto_flatten_seq.AutoFlattenSeq cannot be cast to instaparse.auto_flatten_seq.AutoFlattenSeq at instaparse.auto_flatten_seq$hash_cat.invokePrim(auto_flatten_seq.clj:149) at instaparse.auto_flatten_seq$hash_cat.invoke(auto_flatten_seq.clj) at instaparse.auto_flatten_seq.AutoFlattenSeq.conj_flat(auto_flatten_seq.clj:111)

Engelberg commented 10 years ago

Apologies for my naivete, but what does "lein check" do?

jafingerhut commented 10 years ago

It simply compiles the files in your :source-paths (which is ["src"] by default in Leiningen if you don't override it) and their subdirectories, with reflection warnings enabled.

It isn't necessarily a bug that this gives an error, but it is odd, and maybe worth investigating the cause, if it isn't difficult to determine.

mishadoff commented 9 years ago

This is, actually, a clojure related bug. See http://dev.clojure.org/jira/browse/CLJ-979 Fix is planned in 1.7-alpha5

Engelberg commented 9 years ago

Glad to hear this is being fixed. I'll close out this issue, then.

jafingerhut commented 9 years ago

I still see the same error with the same command for Leiningen version 2.5.0, Java 1.7.0_45, on Mac OS X 10.9.5 and Clojure 1.7.0-alpha5.