<< Back to previous view

[MATCH-126] Shadowing bindings does not work as expected Created: 12/Jan/18  Updated: 12/Jan/18

Status: Open
Project: core.match
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Critical
Reporter: Magnar Sveen Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: None


 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






Generated at Wed Jan 17 18:22:45 CST 2018 using JIRA 4.4#649-r158309.