core.match

Empty Vector Patterns Fail to Match

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

Description

(match [[]]
[[]] "asdf")
#<RuntimeException java.lang.RuntimeException: java.lang.Exception: No match found. Followed 0 branches. Breadcrumbs: []>

Macro-expand'd:

(let*
[ocr-4856 []]
(clojure.core/cond
(clojure.core/and
(clojure.core/instance? clojure.lang.IPersistentVector ocr-4856)
(clojure.core/= (clojure.core/count ocr-4856) 1)) (clojure.core/let
[ocr-4856_0__4857
(clojure.core/nth
ocr-4856
0)]
(clojure.core/cond
(clojure.core/=
ocr-4856_0__4857
nil)
"asdf"
:else
(throw
(java.lang.Exception.
(clojure.core/str
"No match found. "
"Followed "
1
" branches."
" Breadcrumbs: "
'[(clojure.core/and
(clojure.core/instance?
clojure.lang.IPersistentVector
ocr-4856)
(clojure.core/=
(clojure.core/count
ocr-4856)
1))])))))
:else (throw
(java.lang.Exception.
(clojure.core/str
"No match found. "
"Followed "
0
" branches."
" Breadcrumbs: "
'[])))))

Clearly this test is the issue: (clojure.core/= (clojure.core/count ocr-4856) 1))

Activity

David Nolen made changes -
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: