[MATCH-68] Vector match "underflow" => IndexOutOfBoundsException Created: 22/Apr/13 Updated: 28/Jul/13 Resolved: 16/Jun/13
|Reporter:||Chas Emerick||Assignee:||David Nolen|
|Patch:||Code and Test|
This fails with 0.2.0-alpha12:
I expect nil, but an unguarded subvec call throws an IndexOutOfBoundsException.
A WIP patch is attached that fixes this (perhaps incorrectly) but which produced regressions (outside of core.match), e.g.
The patch also "fixes" this (by changing pattern-compare behaviour for rest VectorPattern s, but that leads to a regression in the vector-pattern-rest-2 testcase in core.match.
(Original discussion with further background here.)
|Comment by Greg Chapman [ 24/Apr/13 5:26 PM ]|
FWIW, I've been using the patch described here, and haven't yet run into any problems, though I also haven't used core.match that much. Anyway, with the change to subvec-inline, both of the cases here act as expected (producing nil and :a, respectively).
(I note looking at my patch that I'm doubly-evaluating ocr in the second overload; obviously that should be fixed with a let binding).
|Comment by David Nolen [ 18/May/13 3:11 PM ]|
The patch looks like it's going in the right direction. Can you explain why your patch without the pattern-compares case causes the second example to fail?
|Comment by David Nolen [ 16/Jun/13 10:10 PM ]|