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

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: