Uploaded image for project: 'ClojureScript'
  1. CLJS-1518

Case macro expansion evaluates expression twice

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: 1.7.228, 1.7.145
    • Fix versions: 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))
      

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              pangloss Darrick Wiebe
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: