<< Back to previous view

[MATCH-54] Cannot AOT with certain match expression. Created: 04/Mar/12  Updated: 28/Jul/13  Resolved: 15/Jun/13

Status: Closed
Project: core.match
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Jason Jackson Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

If you try to AOT this code, you get an exception.

(defn -main [& args]
  (println args)
  (let [x nil] 
    (match x
      ["=" _ _] true
      [[:invoke _] _] true)))

Stack Trace:

Compiling foo.core
Exception in thread "main" java.lang.IndexOutOfBoundsException, compiling:(foo/core.clj:8)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6416)
	at clojure.lang.Compiler.analyze(Compiler.java:6216)
	at clojure.lang.Compiler.analyze(Compiler.java:6177)
	at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5572)
	at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:5873)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
	at clojure.lang.Compiler.analyze(Compiler.java:6216)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6397)
	at clojure.lang.Compiler.analyze(Compiler.java:6216)
	at clojure.lang.Compiler.analyze(Compiler.java:6177)
	at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5572)
	at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5008)
	at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3629)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6407)
	at clojure.lang.Compiler.analyze(Compiler.java:6216)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6397)
	at clojure.lang.Compiler.analyze(Compiler.java:6216)
	at clojure.lang.Compiler.access$100(Compiler.java:37)
	at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:492)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6409)
	at clojure.lang.Compiler.analyze(Compiler.java:6216)
	at clojure.lang.Compiler.analyze(Compiler.java:6177)
	at clojure.lang.Compiler.compile1(Compiler.java:6980)
	at clojure.lang.Compiler.compile(Compiler.java:7046)
	at clojure.lang.RT.compile(RT.java:385)
	at clojure.lang.RT.load(RT.java:425)
	at clojure.lang.RT.load(RT.java:398)
	at clojure.core$load$fn__4610.invoke(core.clj:5386)
	at clojure.core$load.doInvoke(core.clj:5385)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invoke(core.clj:5200)
	at clojure.core$compile$fn__4615.invoke(core.clj:5397)
	at clojure.core$compile.invoke(core.clj:5396)
	at user$eval27.invoke(NO_SOURCE_FILE:1)
	at clojure.lang.Compiler.eval(Compiler.java:6465)
	at clojure.lang.Compiler.eval(Compiler.java:6455)
	at clojure.lang.Compiler.eval(Compiler.java:6431)
	at clojure.core$eval.invoke(core.clj:2795)
	at clojure.main$eval_opt.invoke(main.clj:296)
	at clojure.main$initialize.invoke(main.clj:315)
	at clojure.main$null_opt.invoke(main.clj:348)
	at clojure.main$main.doInvoke(main.clj:426)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:405)
	at clojure.lang.AFn.applyToHelper(AFn.java:163)
	at clojure.lang.Var.applyTo(Var.java:518)
	at clojure.main.main(main.java:37)
Caused by: java.lang.IndexOutOfBoundsException
	at clojure.lang.PersistentVector.arrayFor(PersistentVector.java:106)
	at clojure.lang.PersistentVector.nth(PersistentVector.java:110)
	at clojure.lang.RT.nth(RT.java:741)
	at clojure.core.match.PatternRow.invoke(match.clj:327)
	at clojure.core.match.PatternMatrix.pattern_at(match.clj:713)
	at clojure.core.match$useful_p_QMARK_.invoke(match.clj:778)
	at clojure.core.match.PatternMatrix$iter__832__838$fn__839$iter__834__840$fn__841$fn__842.invoke(match.clj:735)
	at clojure.core.match.PatternMatrix$iter__832__838$fn__839$iter__834__840$fn__841.invoke(match.clj:733)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:60)
	at clojure.lang.RT.seq(RT.java:466)
	at clojure.core$seq.invoke(core.clj:133)
	at clojure.core.match.PatternMatrix$iter__832__838$fn__839.invoke(match.clj:734)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:67)
	at clojure.lang.RT.seq(RT.java:466)
	at clojure.core$seq.invoke(core.clj:133)
	at clojure.core$partition$fn__3913.invoke(core.clj:2777)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:60)
	at clojure.lang.RT.seq(RT.java:466)
	at clojure.core$seq.invoke(core.clj:133)
	at clojure.core$map$fn__3811.invoke(core.clj:2424)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:60)
	at clojure.lang.Cons.next(Cons.java:39)
	at clojure.lang.PersistentVector.create(PersistentVector.java:50)
	at clojure.lang.LazilyPersistentVector.create(LazilyPersistentVector.java:31)
	at clojure.core$vec.invoke(core.clj:345)
	at clojure.core.match.PatternMatrix.useful_matrix(match.clj:733)
	at clojure.core.match.PatternMatrix.necessary_column(match.clj:725)
	at clojure.core.match.PatternMatrix$choose_column__815.invoke(match.clj:690)
	at clojure.core.match.PatternMatrix.compile(match.clj:708)
	at clojure.core.match$first_column_chosen_case$switch_clauses__780$fn__781.invoke(match.clj:613)
	at clojure.core$map$fn__3815.invoke(core.clj:2437)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:60)
	at clojure.lang.RT.seq(RT.java:466)
	at clojure.core$seq.invoke(core.clj:133)
	at clojure.core$reduce.invoke(core.clj:5994)
	at clojure.core$into.invoke(core.clj:6004)
	at clojure.core.match$first_column_chosen_case$switch_clauses__780.invoke(match.clj:616)
	at clojure.core.match$first_column_chosen_case.invoke(match.clj:646)
	at clojure.core.match.PatternMatrix.compile(match.clj:710)
	at clojure.core.match$first_column_chosen_case$switch_clauses__780$fn__781.invoke(match.clj:613)
	at clojure.core$map$fn__3815.invoke(core.clj:2437)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:60)
	at clojure.lang.RT.seq(RT.java:466)
	at clojure.core$seq.invoke(core.clj:133)
	at clojure.core$reduce.invoke(core.clj:5994)
	at clojure.core$into.invoke(core.clj:6004)
	at clojure.core.match$first_column_chosen_case$switch_clauses__780.invoke(match.clj:616)
	at clojure.core.match$first_column_chosen_case.invoke(match.clj:646)
	at clojure.core.match.PatternMatrix.compile(match.clj:710)
	at clojure.core.match$clj_form.invoke(match.clj:1616)
	at clojure.core.match$match.doInvoke(match.clj:1645)
	at clojure.lang.RestFn.invoke(RestFn.java:573)
	at clojure.lang.Var.invoke(Var.java:426)
	at clojure.lang.AFn.applyToHelper(AFn.java:193)
	at clojure.lang.Var.applyTo(Var.java:518)
	at clojure.lang.Compiler.macroexpand1(Compiler.java:6320)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6395)
	... 46 more


 Comments   
Comment by David Nolen [ 15/Jun/13 10:33 PM ]

as far as I can tell this AOT bug is resolved in master

Generated at Fri Oct 31 14:32:02 CDT 2014 using JIRA 4.4#649-r158309.