<< Back to previous view

[ASYNC-37] failing set! case Created: 15/Nov/13  Updated: 20/Nov/13  Resolved: 20/Nov/13

Status: Resolved
Project: core.async
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Ghadi Shayban
Resolution: Completed Votes: 0
Labels: None

Patch: Code and Test

 Description   
(ns example.core
  (:require-macros [cljs.core.async.macros :refer [go]]))

(def foo nil)

(go
  (set! foo "nope"))

Results in the following exception:

clojure.lang.ExceptionInfo: failed compiling file:src/example/core.cljs
                core.clj:4327 clojure.core/ex-info
             compiler.clj:991 cljs.compiler/compile-file
            compiler.clj:1052 cljs.compiler/compile-root
              closure.clj:398 cljs.closure/compile-dir
              closure.clj:437 cljs.closure/eval2663[fn]
              closure.clj:301 cljs.closure/eval2591[fn]
              closure.clj:451 cljs.closure/eval2650[fn]
              closure.clj:301 cljs.closure/eval2591[fn]
              compiler.clj:44 cljsbuild.compiler.SourcePaths/fn
                core.clj:2485 clojure.core/map[fn]
              LazySeq.java:42 clojure.lang.LazySeq.sval
              LazySeq.java:60 clojure.lang.LazySeq.seq
                  RT.java:484 clojure.lang.RT.seq
                 core.clj:133 clojure.core/seq
                 core.clj:617 clojure.core/apply
                core.clj:2514 clojure.core/mapcat
              RestFn.java:423 clojure.lang.RestFn.invoke
              compiler.clj:44 cljsbuild.compiler/cljsbuild.compiler.SourcePaths
             closure.clj:1007 cljs.closure/build
              closure.clj:981 cljs.closure/build
              compiler.clj:58 cljsbuild.compiler/compile-cljs[fn]
              compiler.clj:57 cljsbuild.compiler/compile-cljs
             compiler.clj:158 cljsbuild.compiler/run-compiler
form-init2323732218988862436.clj:1 user/eval3005[fn]
form-init2323732218988862436.clj:1 user/eval3005[fn]
              LazySeq.java:42 clojure.lang.LazySeq.sval
              LazySeq.java:60 clojure.lang.LazySeq.seq
                  RT.java:484 clojure.lang.RT.seq
                 core.clj:133 clojure.core/seq
                core.clj:2780 clojure.core/dorun
                core.clj:2796 clojure.core/doall
form-init2323732218988862436.clj:1 user/eval3005
           Compiler.java:6619 clojure.lang.Compiler.eval
           Compiler.java:6609 clojure.lang.Compiler.eval
           Compiler.java:7064 clojure.lang.Compiler.load
           Compiler.java:7020 clojure.lang.Compiler.loadFile
                 main.clj:294 clojure.main/load-script
                 main.clj:299 clojure.main/init-opt
                 main.clj:327 clojure.main/initialize
                 main.clj:362 clojure.main/null-opt
                 main.clj:440 clojure.main/main
              RestFn.java:421 clojure.lang.RestFn.invoke
                 Var.java:419 clojure.lang.Var.invoke
                 AFn.java:163 clojure.lang.AFn.applyToHelper
                 Var.java:532 clojure.lang.Var.applyTo
                 main.java:37 clojure.main.main
Caused by: clojure.lang.ExceptionInfo: nth not supported on this type: Symbol
                core.clj:4327 clojure.core/ex-info
             analyzer.clj:243 cljs.analyzer/error
            analyzer.clj:1222 cljs.analyzer/analyze
            analyzer.clj:1219 cljs.analyzer/analyze
             compiler.clj:873 cljs.compiler/compile-file*
             compiler.clj:984 cljs.compiler/compile-file
Caused by: java.lang.UnsupportedOperationException: nth not supported on this type: Symbol
                  RT.java:857 clojure.lang.RT.nthFrom
                  RT.java:807 clojure.lang.RT.nth
           ioc_macros.clj:418 cljs.core.async.impl.ioc-macros/eval5251[fn]
             MultiFn.java:227 clojure.lang.MultiFn.invoke
           ioc_macros.clj:627 cljs.core.async.impl.ioc-macros/eval5429[fn]
           ioc_macros.clj:110 cljs.core.async.impl.ioc-macros/all[fn]
            protocols.clj:143 clojure.core.protocols/fn
             protocols.clj:19 clojure.core.protocols/fn[fn]
             protocols.clj:31 clojure.core.protocols/seq-reduce
             protocols.clj:54 clojure.core.protocols/fn
             protocols.clj:13 clojure.core.protocols/fn[fn]
                core.clj:6177 clojure.core/reduce
           ioc_macros.clj:108 cljs.core.async.impl.ioc-macros/all[fn]
           ioc_macros.clj:674 cljs.core.async.impl.ioc-macros/parse-to-state-machine[fn]
            ioc_macros.clj:68 cljs.core.async.impl.ioc-macros/get-plan
           ioc_macros.clj:668 cljs.core.async.impl.ioc-macros/parse-to-state-machine
           ioc_macros.clj:809 cljs.core.async.impl.ioc-macros/state-machine
                macros.clj:18 cljs.core.async.macros/go
              RestFn.java:142 clojure.lang.RestFn.applyTo
                 core.clj:621 clojure.core/apply
            analyzer.clj:1129 cljs.analyzer/macroexpand-1
            analyzer.clj:1164 cljs.analyzer/analyze-seq
            analyzer.clj:1230 cljs.analyzer/analyze


 Comments   
Comment by Ghadi Shayban [ 18/Nov/13 11:07 PM ]

Tentative fix on branch ASYNC-37. Can someone review?

Generated at Wed Nov 26 22:30:34 CST 2014 using JIRA 4.4#649-r158309.