ClojureScript

Case macro expansion evaluates expression twice

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: 1.7.145, 1.7.228
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    The issue is present in version 1.7.189.
  • Patch:
    Code and Test

Description

The value being checked is evaluated twice if all of the test values are keywords.

(macroexpand-1 '(case (expensive) :a 1 2))
(cljs.core/let [G__123555 (if (cljs.core/keyword? (expensive)) (.-fqn (expensive)) nil)]
  (case* G__123555 [["a"]] [1] 2))

Activity

David Nolen made changes -
Field Original Value New Value
Priority Major [ 3 ] Minor [ 4 ]
Mike Fikes made changes -
Assignee Mike Fikes [ mfikes ]
Mike Fikes made changes -
Assignee Mike Fikes [ mfikes ] David Nolen [ dnolen ]
Attachment CLJS-1518.patch [ 15418 ]
Affects Version/s 1.7.228 [ 10653 ]
Patch Code and Test [ 10002 ]
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: