ClojureScript

Terrible error message if I try to use :refer :all

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.10.238
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

I had .cljc files that worked fine in JVM Clojure, but in ClojureScript I was getting this error:

---- Could not Analyze src/cljc/zm/ops1OP.cljc line:1 column:1 ----

Don't know how to create ISeq from: clojure.lang.Keyword

1 (ns zm.ops1OP
^--- Don't know how to create ISeq from: clojure.lang.Keyword
2 "1OP operations"
3 #?(:cljs (:require-macros [zm.util :refer [v4-5]]))
4 (:require [zm.memory :refer :all]

---- Analysis Error : Please see src/cljc/zm/ops1OP.cljc ----

The problem is the :refer :all, and the error message makes sense in hindsight, but CLJS could do much better at pointing out this mistake.

Activity

Hide
Mike Fikes added a comment -

Here is how things currently look if you first load the core specs and then use the work from CLJS-2913:

cljs.user=> (require '[cljs.core.specs.alpha])
nil
cljs.user=> (require '[clojure.set :refer :all])
Syntax error macroexpanding cljs.core/require at (<cljs repl>:1:1).
:all - failed: coll? at: [:libspec :spec :lib+opts :options :refer] spec: :cljs.core.specs.alpha/refer
[clojure.set :refer :all] - failed: simple-symbol? at: [:libspec :spec :lib :sym] spec: :cljs.core.specs.alpha/lib
[clojure.set :refer :all] - failed: string? at: [:libspec :spec :lib :str] spec: :cljs.core.specs.alpha/lib
(quote [clojure.set :refer :all]) - failed: #{:verbose :reload :reload-all} at: [:flag]
cljs.user=>
Show
Mike Fikes added a comment - Here is how things currently look if you first load the core specs and then use the work from CLJS-2913:
cljs.user=> (require '[cljs.core.specs.alpha])
nil
cljs.user=> (require '[clojure.set :refer :all])
Syntax error macroexpanding cljs.core/require at (<cljs repl>:1:1).
:all - failed: coll? at: [:libspec :spec :lib+opts :options :refer] spec: :cljs.core.specs.alpha/refer
[clojure.set :refer :all] - failed: simple-symbol? at: [:libspec :spec :lib :sym] spec: :cljs.core.specs.alpha/lib
[clojure.set :refer :all] - failed: string? at: [:libspec :spec :lib :str] spec: :cljs.core.specs.alpha/lib
(quote [clojure.set :refer :all]) - failed: #{:verbose :reload :reload-all} at: [:flag]
cljs.user=>

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: