<< Back to previous view

[CLJ-1309] Bindings after :as in list destructuring should throw error Created: 19/Dec/13  Updated: 15/May/17  Resolved: 15/May/17

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: Release 1.4, Release 1.5
Fix Version/s: Release 1.9

Type: Enhancement Priority: Minor
Reporter: ben wolfson Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: Compiler, destructuring, errormsgs

Approval: Ok


If you try to define a vector binding with anything at all after an :as parameter, you do not get a compiler error, and the binding is silently swallowed:

user> ((fn [[:as y z]] y) [1 2])
[1 2]

If you try to actually use the binding, there will be a compiler error (the compiler will complain that there's no binding for the symbol), but the actual error has already happened, and should be reported earlier.

Comment by Alex Miller [ 15/May/17 4:40 PM ]

In 1.9, this now throws an error as the spec is violated.

Generated at Tue Oct 24 06:37:09 CDT 2017 using JIRA 4.4#649-r158309.