leonoel / cloroutine

Coroutine support for clojure
Eclipse Public License 2.0
230 stars 10 forks source link

[cljs] Warning when specter's setval is used in async #7

Open Wonko7 opened 5 years ago

Wonko7 commented 5 years ago

Hi!

When specter's setval is called within an async block the following warning appears:

------ WARNING #1 - :redef-in-file ---------------------------------------------
 File: /tmp/naked/src/naked/core.cljs:11:22
--------------------------------------------------------------------------------
   8 | (defn start []
   9 |   (async
  10 |     (let [user-info  {:hello {:thing "hihi"}}
  11 |           user-info2 (setval [:hello :thing] "haha" user-info)]
----------------------------^---------------------------------------------------
 pathcache26917 at line 11 is being replaced
--------------------------------------------------------------------------------
  12 |       (println user-info)
  13 |       (println user-info2))))
  14 |
--------------------------------------------------------------------------------

There are no warnings inside a go block, see master vs go branch: https://github.com/Wonko7/warning-specter-async

leonoel commented 5 years ago

setval emits a def, then cr wraps it in a letfn, and this combination seems to confuse the compiler. I filed an issue with a minimal repro.

Wonko7 commented 5 years ago

Thanks!