Open issues

Shadowing bindings does not work as expected
MATCH-126
Apparent regression for test sharing literals
MATCH-101
recur detection logic is too naive
MATCH-95
vector patterns should work on seq
MATCH-31
Keyword literal as function apply(:<<) result
MATCH-125
Exception when regexp-matching on a map key that does not exist.
MATCH-123
Or matches with vectors improperly match
MATCH-122
core.match clojurescript should be self-host compatible
MATCH-116
Rather simple match fails with code too large
MATCH-114
:as and & interaction issue
MATCH-112
convert to .cljc
MATCH-110
Map pattern with vector key raises "clojure.lang.PersistentVector cannot be cast to clojure.lang.Named" exception
MATCH-107
variable binding fails with :or guard
MATCH-106
Do :guard predicates really need to handle :clojure.core.match/not-found?
MATCH-102
Simple capturing of :or matches with :as doesn't work
MATCH-93
ignore duplicate wildcard check if matching a local multiple times in same pattern row
MATCH-90
Tidy up for 0.2.0, add comprehensive doc strings
MATCH-79
Switches on literals should happen via `case` not `cond`
MATCH-78
rest patterns don't work on arrays
MATCH-75
pass occurrence to emit-pattern
MATCH-74
cata matching
MATCH-65
Duplicate wildcard detection in pattern row doesn't account for locals
MATCH-49
Allow or'ing of guard functions
MATCH-40
Optimized pattern matching on deftype/record, POJOs
MATCH-4
Empty seq match can throw Exception
MATCH-120
Simplify computation of necessary column
MATCH-118
Outdated dependencies
MATCH-117
AppPattern with single wildcard throws exception
MATCH-115
Typo in match.clj
MATCH-113
Upgrade org.clojure/tools.analyzer.jvm dependency to "0.6.6"
MATCH-108
Regex: only attempt to match string values.
MATCH-105
Support for lists in patterns.
MATCH-103
complexity analysis
MATCH-72
Improve match compile times
MATCH-64
Implement (p|q)ba heuristics
MATCH-8
Matching Diagnostics
MATCH-2
Fix typo on multimehod
MATCH-119
Example in Overview Wiki Page Results in an Exception
MATCH-99
Eliminate distinction between leaf-bind-expr and bind-expr
MATCH-7
issue 1 of 39

Shadowing bindings does not work as expected

Description

This is a bug with core.match, or (far less likely) with the macro expansion in Clojure.

This code:

```
(let [foo [:bar :baz]]
(match foo
[:bar boo] boo
:else :got-else))
```

returns `:baz`. While this code:

```
(let [foo [:bar :baz]]
(match foo
[:bar foo] foo
:else :got-else))
```

returns `:got-else`.

They should be equal, since the `foo` in the match should shadow the `foo` in
the let. In fact, when running `macroexpand-1` on these forms, they only differ in
the gensym numbers and the letter `f` vs `b` in `foo` and `bar`.

I have created a repo that reproduces the bug:

https://github.com/magnars/bug-examples/tree/core-match-shadow-bindings

Environment

None

Status

Assignee

David Nolen

Reporter

import

Labels

None

Approval

None

Patch

None

Priority

Critical
Configure