Rich pushed a commit to master that will now detect this invalid primitive type hint and throw a compiler error.
Shantanu - your asphalt library will fail due to this new compile error. You should change your two ^int type hints to casts instead (int ...) to fix the error. FYI, this type mismatch was ignored (effectively a no-op) until the change from CLJ-1533 in 1.8.0-alpha2 which is why we did not see it previously. On Wednesday, November 11, 2015 at 8:23:16 AM UTC-6, Nicola Mometto wrote: > > To be honest I'm not sure this should even be a valid use of type hints. > You're telling the compiler that the result of (foo) is an int, when it is > infact a long. > > The correct way to do this should be: > (Integer/bitCount (int (foo)) > > Again, lack of specification on what the correct type hinting semantics > should be make it hard to evaluate if this should be considered a bug or > just an user error that previously just got ignored. > > On 11 Nov 2015, at 12:08, Shantanu Kumar <kumar.shant...@gmail.com> wrote: > > Thanks, Nicola! > > Filed the ticket: http://dev.clojure.org/jira/browse/CLJ-1846 > > Shantanu > > On Wednesday, 11 November 2015 17:13:05 UTC+5:30, Nicola Mometto wrote: >> >> Here's a minimal repro case: >> >> user=> (defn foo ^long [] 1) >> #'user/foo >> user=> (Integer/bitCount ^int (foo)) >> VerifyError (class: user$eval13, method: invokeStatic signature: >> ()Ljava/lang/Object;) Expecting to find integer on stack >> java.lang.Class.getDeclaredConstructors0 (Class.java:-2) >> >> >> On 11 Nov 2015, at 07:46, Shantanu Kumar <kumar.s...@gmail.com> wrote: >> >> One of my libraries (https://github.com/kumarshantanu/asphalt) is >> failing to compile with 1.8 (works fine with 1.6, 1.7); the stack trace is >> below: >> >> $ lein do clean, with-profile dev,c18 test >> Exception in thread "main" java.lang.VerifyError: (class: >> asphalt/core$invoke_with_transaction, method: invokeStatic signature: >> (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;) >> Expecting to find integer on stack, compiling:(core.clj:201:1) >> at clojure.lang.Compiler$DefExpr.eval(Compiler.java:463) >> at clojure.lang.Compiler.eval(Compiler.java:6918) >> at clojure.lang.Compiler.load(Compiler.java:7360) >> at clojure.lang.RT.loadResourceScript(RT.java:372) >> at clojure.lang.RT.loadResourceScript(RT.java:363) >> at clojure.lang.RT.load(RT.java:453) >> at clojure.lang.RT.load(RT.java:419) >> at clojure.core$load$fn__5673.invoke(core.clj:5895) >> at clojure.core$load.invokeStatic(core.clj:5894) >> at clojure.core$load_one.invokeStatic(core.clj:5694) >> at clojure.core$load_one.invoke(core.clj) >> at clojure.core$load_lib$fn__5622.invoke(core.clj:5739) >> at clojure.core$load_lib.invokeStatic(core.clj:5738) >> at clojure.core$load_lib.doInvoke(core.clj) >> at clojure.lang.RestFn.applyTo(RestFn.java:142) >> at clojure.core$apply.invokeStatic(core.clj:647) >> at clojure.core$load_libs.invokeStatic(core.clj:5776) >> at clojure.core$load_libs.doInvoke(core.clj) >> at clojure.lang.RestFn.applyTo(RestFn.java:137) >> at clojure.core$apply.invokeStatic(core.clj:647) >> at clojure.core$require.invokeStatic(core.clj:5798) >> at clojure.core$require.doInvoke(core.clj) >> at clojure.lang.RestFn.invoke(RestFn.java:457) >> at >> asphalt.test_util$eval198$loading__5565__auto____199.invoke(test_util.clj:1) >> at asphalt.test_util$eval198.invokeStatic(test_util.clj:1) >> at asphalt.test_util$eval198.invoke(test_util.clj) >> at clojure.lang.Compiler.eval(Compiler.java:6913) >> at clojure.lang.Compiler.eval(Compiler.java:6902) >> at clojure.lang.Compiler.load(Compiler.java:7360) >> at clojure.lang.RT.loadResourceScript(RT.java:372) >> at clojure.lang.RT.loadResourceScript(RT.java:363) >> at clojure.lang.RT.load(RT.java:453) >> at clojure.lang.RT.load(RT.java:419) >> at clojure.core$load$fn__5673.invoke(core.clj:5895) >> at clojure.core$load.invokeStatic(core.clj:5894) >> at clojure.core$load_one.invokeStatic(core.clj:5694) >> at clojure.core$load_one.invoke(core.clj) >> at clojure.core$load_lib$fn__5622.invoke(core.clj:5739) >> at clojure.core$load_lib.invokeStatic(core.clj:5738) >> at clojure.core$load_lib.doInvoke(core.clj) >> at clojure.lang.RestFn.applyTo(RestFn.java:142) >> at clojure.core$apply.invokeStatic(core.clj:647) >> at clojure.core$load_libs.invokeStatic(core.clj:5776) >> at clojure.core$load_libs.doInvoke(core.clj) >> at clojure.lang.RestFn.applyTo(RestFn.java:137) >> at clojure.core$apply.invokeStatic(core.clj:647) >> at clojure.core$require.invokeStatic(core.clj:5798) >> at clojure.core$require.doInvoke(core.clj) >> at clojure.lang.RestFn.invoke(RestFn.java:457) >> at >> asphalt.core_test$eval192$loading__5565__auto____193.invoke(core_test.clj:1) >> at asphalt.core_test$eval192.invokeStatic(core_test.clj:1) >> at asphalt.core_test$eval192.invoke(core_test.clj) >> at clojure.lang.Compiler.eval(Compiler.java:6913) >> at clojure.lang.Compiler.eval(Compiler.java:6902) >> at clojure.lang.Compiler.load(Compiler.java:7360) >> at clojure.lang.RT.loadResourceScript(RT.java:372) >> at clojure.lang.RT.loadResourceScript(RT.java:363) >> at clojure.lang.RT.load(RT.java:453) >> at clojure.lang.RT.load(RT.java:419) >> at clojure.core$load$fn__5673.invoke(core.clj:5895) >> at clojure.core$load.invokeStatic(core.clj:5894) >> at clojure.core$load_one.invokeStatic(core.clj:5694) >> at clojure.core$load_one.invoke(core.clj) >> at clojure.core$load_lib$fn__5622.invoke(core.clj:5739) >> at clojure.core$load_lib.invokeStatic(core.clj:5738) >> at clojure.core$load_lib.doInvoke(core.clj) >> at clojure.lang.RestFn.applyTo(RestFn.java:142) >> at clojure.core$apply.invokeStatic(core.clj:647) >> at clojure.core$load_libs.invokeStatic(core.clj:5776) >> at clojure.core$load_libs.doInvoke(core.clj) >> at clojure.lang.RestFn.applyTo(RestFn.java:137) >> at clojure.core$apply.invokeStatic(core.clj:647) >> at clojure.core$require.invokeStatic(core.clj:5798) >> at clojure.core$require.doInvoke(core.clj) >> at clojure.lang.RestFn.applyTo(RestFn.java:137) >> at clojure.core$apply.invokeStatic(core.clj:647) >> at clojure.core$apply.invoke(core.clj) >> at user$eval91.invokeStatic(form-init7505432955041312280.clj:1) >> at user$eval91.invoke(form-init7505432955041312280.clj) >> at clojure.lang.Compiler.eval(Compiler.java:6913) >> at clojure.lang.Compiler.eval(Compiler.java:6903) >> at clojure.lang.Compiler.load(Compiler.java:7360) >> at clojure.lang.Compiler.loadFile(Compiler.java:7298) >> 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) >> 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) >> at clojure.main$main.invokeStatic(main.clj:421) >> at clojure.main$main.doInvoke(main.clj) >> 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.VerifyError: (class: >> asphalt/core$invoke_with_transaction, method: invokeStatic signature: >> (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;) >> Expecting to find integer on stack >> at java.lang.Class.getDeclaredConstructors0(Native Method) >> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) >> at java.lang.Class.getConstructor0(Class.java:3075) >> at java.lang.Class.newInstance(Class.java:412) >> at clojure.lang.Compiler$ObjExpr.eval(Compiler.java:4902) >> at clojure.lang.Compiler$DefExpr.eval(Compiler.java:450) >> ... 95 more >> >> I welcome any suggestion/pointers on preparing an isolated test case. >> >> Shantanu >> >> On Tuesday, 10 November 2015 23:00:47 UTC+5:30, Alex Miller wrote: >>> >>> Clojure 1.8.0-RC1 is now available. *This build is a "release >>> candidate"!* We would appreciate any and all testing you can do on your >>> own libraries or internal projects to find problems. If no problems are >>> found, we expect to make this the 1.8.0 final release! >>> >>> Try it via >>> >>> - Download: >>> https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0-RC1 >>> - Leiningen: [org.clojure/clojure "1.8.0-RC1"] >>> >>> Below is the only change since 1.8.0-beta2. See the full 1.8 change log >>> here: https://github.com/clojure/clojure/blob/master/changes.md. >>> >>> - CLJ-1845 <http://dev.clojure.org/jira/browse/CLJ-1845> Make >>> clojure.core/load dynamic so it can be redef'ed even with direct linking >>> >>> >>> > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.