Details
-
Type:
Defect
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
(let [l '(1 2 3)]
(match [l]
[([a & [b & [c d]]] :seq)] :a0
:else :a1))
Matches when it shouldn't.
Activity
David Nolen
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Priority | Major [ 3 ] | Critical [ 2 ] |
David Nolen
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
David Nolen
made changes -
| Resolution | Completed [ 1 ] | |
| Status | In Progress [ 3 ] | Resolved [ 5 ] |
Another example of (I think) the same issue:
user=> (let [x ()] (match [x] [([h & t] :seq)] [h t] [_] :a1))
[nil ()]
Perhaps SeqPattern's IPatternCompile should call seq in order to filter empty seqs? (e.g.:
(to-source* [this ocr]
`(and (or (seq? ~ocr) (sequential? ~ocr)) (seq ~ocr)))