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

Map-destructuring :or fumble needs compiler warning

Description

Here is a map-destructuring blunder that I wish the compiler warned about:

1 2 (defn server [{servlet ::servlet type ::type :or {::type :jetty} :as service-map}])

It would be splendid to get a warning that :or keys that are not symbols being bound have no effect.

The incomplete code snippet above comes from Pedestal.service 0.1.0.

Here is a complete one-line example with the coding error:

1 2 3 4 5 user> (defn picnic [{botulism :botulism :or {:botulism 6}}] botulism) #'user/picnic user> (picnic {}) nil user> ;; I intended 6.

Environment

None

Status

Assignee

Unassigned

Reporter

import

Approval

None

Patch

Code and Test

Affects versions

Release 1.5
Release 1.8

Priority

Minor