<< Back to previous view

[CLJS-640] instance? arity is incorrect in analyzer Created: 28/Oct/13  Updated: 05/Nov/13  Resolved: 04/Nov/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Trivial
Reporter: Ghadi Shayban Assignee: Unassigned
Resolution: Completed Votes: 1
Labels: None


 Description   

https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L1114-L1115

The predicates are missing 'x'.

Clojure 1.6 now throws ArityException on instance? (which is a special form)



 Comments   
Comment by David Nolen [ 28/Oct/13 11:20 AM ]

Good catch seems simple enough to fix.

Comment by Trevor Wennblom [ 04/Nov/13 12:51 PM ]

+1 here. Clojure 1.6.0-alpha1 doesn't compile ClojureScript with 0.0-1978, but does with 0.0-1934.

I see this exception:

% lein cljsbuild once
Compiling ClojureScript.
Compiling "public/main.js" from ["src-cljs"]...
Compiling "public/main.js" failed.
clojure.lang.ArityException: Wrong number of args (1) passed to: core/instance?
  at clojure.lang.AFn.throwArity(AFn.java:436)
  at clojure.lang.AFn.invoke(AFn.java:39)
  at cljs.analyzer$source_path.invoke(analyzer.clj:1114)
  at cljs.analyzer$forms_seq.invoke(analyzer.clj:1122)
  at cljs.analyzer$analyze_file.invoke(analyzer.clj:1150)
  at cljs.compiler$parse_ns.invoke(compiler.clj:907)
  at cljs.compiler$parse_ns.invoke(compiler.clj:903)
  at cljs.compiler$to_target_file.invoke(compiler.clj:992)
  at cljs.compiler$compile_root.invoke(compiler.clj:1023)
  at cljs.closure$compile_dir.invoke(closure.clj:399)
  at cljs.closure$eval2504$fn__2505.invoke(closure.clj:431)
  at cljs.closure$eval2431$fn__2432$G__2422__2439.invoke(closure.clj:299)
  at cljs.closure$eval2491$fn__2492.invoke(closure.clj:445)
  at cljs.closure$eval2431$fn__2432$G__2422__2439.invoke(closure.clj:299)
  at cljsbuild.compiler.SourcePaths$fn__2698.invoke(compiler.clj:44)
  at clojure.core$map$fn__4209.invoke(core.clj:2509)
  at clojure.lang.LazySeq.sval(LazySeq.java:42)
  at clojure.lang.LazySeq.seq(LazySeq.java:60)
  at clojure.lang.RT.seq(RT.java:484)
  at clojure.core$seq.invoke(core.clj:133)
  at clojure.core$apply.invoke(core.clj:617)
  at clojure.core$mapcat.doInvoke(core.clj:2538)
  at clojure.lang.RestFn.invoke(RestFn.java:423)
  at cljsbuild.compiler.SourcePaths._compile(compiler.clj:44)
  at cljs.closure$build.invoke(closure.clj:975)
  at cljs.closure$build.invoke(closure.clj:949)
  at cljsbuild.compiler$compile_cljs$fn__2709.invoke(compiler.clj:58)
  at cljsbuild.compiler$compile_cljs.invoke(compiler.clj:57)
  at cljsbuild.compiler$run_compiler.invoke(compiler.clj:156)
  at user$eval2835$iter__2838__2842$fn__2843.invoke(form-init9172214651958793811.clj:1)
  at clojure.lang.LazySeq.sval(LazySeq.java:42)
  at clojure.lang.LazySeq.seq(LazySeq.java:60)
  at clojure.lang.RT.seq(RT.java:484)
  at clojure.core$seq.invoke(core.clj:133)
  at clojure.core$dorun.invoke(core.clj:2807)
  at clojure.core$doall.invoke(core.clj:2823)
  at user$eval2835.invoke(form-init9172214651958793811.clj:1)
  at clojure.lang.Compiler.eval(Compiler.java:6685)
  at clojure.lang.Compiler.eval(Compiler.java:6675)
  at clojure.lang.Compiler.load(Compiler.java:7130)
  at clojure.lang.Compiler.loadFile(Compiler.java:7086)
  at clojure.main$load_script.invoke(main.clj:274)
  at clojure.main$init_opt.invoke(main.clj:279)
  at clojure.main$initialize.invoke(main.clj:307)
  at clojure.main$null_opt.invoke(main.clj:342)
  at clojure.main$main.doInvoke(main.clj:420)
  at clojure.lang.RestFn.invoke(RestFn.java:421)
  at clojure.lang.Var.invoke(Var.java:424)
  at clojure.lang.AFn.applyToHelper(AFn.java:163)
  at clojure.lang.Var.applyTo(Var.java:741)
  at clojure.main.main(main.java:37)
Comment by David Nolen [ 04/Nov/13 12:59 PM ]

fixed, http://github.com/clojure/clojurescript/commit/89aef54a9d507063dd807ff58dd344519954383b

Comment by Trevor Wennblom [ 04/Nov/13 2:37 PM ]

With the patch, after `lein cljsbuild clean` I started to get the following exception.

% lein cljsbuild auto
Compiling ClojureScript.
Compiling "public/main.js" from ["src-cljs"]...
Compiling "public/main.js" failed.
java.lang.IllegalArgumentException: URI is not hierarchical
  at java.io.File.<init>(File.java:392)
  at cljs.analyzer$source_path.invoke(analyzer.clj:1193)
  at cljs.analyzer$forms_seq.invoke(analyzer.clj:1200)
  at cljs.analyzer$analyze_file.invoke(analyzer.clj:1228)
  at cljs.compiler$parse_ns.invoke(compiler.clj:904)
  at cljs.compiler$parse_ns.invoke(compiler.clj:900)
  at cljs.compiler$to_target_file.invoke(compiler.clj:990)
  at cljs.compiler$compile_root.invoke(compiler.clj:1021)
  at cljs.closure$compile_dir.invoke(closure.clj:399)
  at cljs.closure$eval2606$fn__2607.invoke(closure.clj:431)
  at cljs.closure$eval2533$fn__2534$G__2524__2541.invoke(closure.clj:299)
  at cljs.closure$eval2593$fn__2594.invoke(closure.clj:445)
  at cljs.closure$eval2533$fn__2534$G__2524__2541.invoke(closure.clj:299)
  at cljsbuild.compiler.SourcePaths$fn__2803.invoke(compiler.clj:44)
  at clojure.core$map$fn__4207.invoke(core.clj:2485)
  at clojure.lang.LazySeq.sval(LazySeq.java:42)
  at clojure.lang.LazySeq.seq(LazySeq.java:60)
  at clojure.lang.RT.seq(RT.java:484)
  at clojure.core$seq.invoke(core.clj:133)
  at clojure.core$apply.invoke(core.clj:617)
  at clojure.core$mapcat.doInvoke(core.clj:2514)
  at clojure.lang.RestFn.invoke(RestFn.java:423)
  at cljsbuild.compiler.SourcePaths._compile(compiler.clj:44)
  at cljs.closure$build.invoke(closure.clj:981)
  at cljs.closure$build.invoke(closure.clj:951)
  at cljsbuild.compiler$compile_cljs$fn__2814.invoke(compiler.clj:58)
  at cljsbuild.compiler$compile_cljs.invoke(compiler.clj:57)
  at cljsbuild.compiler$run_compiler.invoke(compiler.clj:156)
  at user$eval2940$iter__2943__2947$fn__2948.invoke(form-init6210765904056595312.clj:1)
  at clojure.lang.LazySeq.sval(LazySeq.java:42)
  at clojure.lang.LazySeq.seq(LazySeq.java:60)
  at clojure.lang.RT.seq(RT.java:484)
  at clojure.core$seq.invoke(core.clj:133)
  at clojure.core$dorun.invoke(core.clj:2780)
  at clojure.core$doall.invoke(core.clj:2796)
  at user$eval2940.invoke(form-init6210765904056595312.clj:1)
  at clojure.lang.Compiler.eval(Compiler.java:6619)
  at clojure.lang.Compiler.eval(Compiler.java:6609)
  at clojure.lang.Compiler.load(Compiler.java:7064)
  at clojure.lang.Compiler.loadFile(Compiler.java:7020)
  at clojure.main$load_script.invoke(main.clj:294)
  at clojure.main$init_opt.invoke(main.clj:299)
  at clojure.main$initialize.invoke(main.clj:327)
  at clojure.main$null_opt.invoke(main.clj:362)
  at clojure.main$main.doInvoke(main.clj:440)
  at clojure.lang.RestFn.invoke(RestFn.java:421)
  at clojure.lang.Var.invoke(Var.java:419)
  at clojure.lang.AFn.applyToHelper(AFn.java:163)
  at clojure.lang.Var.applyTo(Var.java:532)
  at clojure.main.main(main.java:37)
Subprocess failed
Comment by David Nolen [ 04/Nov/13 3:36 PM ]

Can you confirm that if we just remove the 2 cond case things work for you?

Comment by Trevor Wennblom [ 05/Nov/13 9:49 PM ]

Hi David - a little late to respond here, but yes it was just the java.net cond that was causing the issue with accessing files in a jar.

Generated at Tue Sep 16 10:32:28 CDT 2014 using JIRA 4.4#649-r158309.