core.match

IndexOutOfBoundsException when matching empty vector

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojure 1.3

Description

Using the latest core.match:

user=> (let [x []] (match [x] [[h & t]] [h t] :else :nomatch))
IndexOutOfBoundsException   clojure.lang.RT.subvec (RT.java:1451)

Not sure if this is the best fix, but I resolved this specific case by slightly changing subvec-inline (see attached diff).

Activity

Hide
David Nolen added a comment -

Thanks for the report. The patch is not going to work - we should be checking that the vector has at least one item.

Show
David Nolen added a comment - Thanks for the report. The patch is not going to work - we should be checking that the vector has at least one item.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: