clj-commons / manifold

A compatibility layer for event-driven abstractions
1.02k stars 106 forks source link

let-flow fails to recognize dependency graph in specific usage of `case` #104

Closed aengelberg closed 7 years ago

aengelberg commented 7 years ago
(d/let-flow [x 1
             y (case :x
                 :x x
                 {})]
  y)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context

Oddly, in my experiments, swapping out {} with a non-map value makes the call succeed.

Clojure version: 1.8.0 Manifold version: 0.1.5

ztellman commented 7 years ago

This is probably a bug in Riddley, I've already had a few issues with case macroexpansion being really fiddly. I'll take a look, thanks for the report. On Mon, Sep 19, 2016 at 2:53 PM Alex Engelberg notifications@github.com wrote:

(d/let-flow [x 1 y (case :x :x x {})] y) CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(cider-repl galaxy-repl:693:1)

Oddly, in my experiments, swapping out {} with a non-map value makes the call succeed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ztellman/manifold/issues/104, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB6P1XULd_zq7X2udXU4wR3pqI0G7M8ks5qrwRigaJpZM4KBAdM .

ztellman commented 7 years ago

This was an issue in how I was parsing the case* special form: I assumed there was only one map in the form, which wasn't true since you defined a default value which was also a map. You can target [riddley "0.1.14"] to fix this, and I'll cut a new release targeting this version in the near future.