We're updating the issue view to help you get more done. 

Silent fail on unspecified map destructuring

Description

When accidentally switching keyword and (previously undefined) symbol in map destructuring, an error is correctly thrown:

(let [{:b b} {:b 1}] b)

=> CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling: (/tmp/form-init7939480206147277345.clj:1:1)

When the symbol ("a" used below) is defined, however, there is a more subtle error:

(def a 0)
(let [{:a a} {:a 1}] a)
=> nil

Expected: Destructuring should only accept the defined keywords :or, :keys, :as, :strs and :syms as keys in a destructuring map.

Environment

None

Status

Assignee

Unassigned

Reporter

Linus Ericsson

Labels

Approval

None

Patch

None

Affects versions

Release 1.7

Priority

Trivial