ClojureScript

Improve sorting on problem printing

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Accepted

Description

Port CLJ-2393 to ClojureScript.

Activity

Hide
Mike Fikes added a comment -

Before:

cljs.user=> (let [[a :as b c] [1 2 3]] a)
clojure.lang.ExceptionInfo: Call to cljs.core/let did not conform to spec:
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
In: [0 0 3] val: (c) fails spec: :cljs.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: (cat :elems (* :cljs.core.specs.alpha/binding-form) :rest (? (cat :amp #{(quote &)} :form :cljs.core.specs.alpha/binding-form)) :as (? (cat :as #{:as} :sym :cljs.core.specs.alpha/local-name))),  Extra input
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: map?
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?
 at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :root-source-info {:source-type :fragment, :source-form (let [[a :as b c] [1 2 3]] a)}, :tag :cljs/analysis-error}
Show
Mike Fikes added a comment - Before:
cljs.user=> (let [[a :as b c] [1 2 3]] a)
clojure.lang.ExceptionInfo: Call to cljs.core/let did not conform to spec:
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
In: [0 0 3] val: (c) fails spec: :cljs.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: (cat :elems (* :cljs.core.specs.alpha/binding-form) :rest (? (cat :amp #{(quote &)} :form :cljs.core.specs.alpha/binding-form)) :as (? (cat :as #{:as} :sym :cljs.core.specs.alpha/local-name))),  Extra input
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: map?
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?
 at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :root-source-info {:source-type :fragment, :source-form (let [[a :as b c] [1 2 3]] a)}, :tag :cljs/analysis-error}
Hide
Mike Fikes added a comment -

After:

For the particular example above, this involves Clojure generating the message, but after the change in ClojureScript, you can easily see the corresponding error update in self-hosted ClojureScript (in this case generated via Planck built with the change):

cljs.user=> (let [[a :as b c] [1 2 3]] a)
            ^
Call to cljs.core$macros/let did not conform to spec:
In: [0 0 3] val: (c) fails spec: :cljs.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: (cat :elems (* :cljs.core.specs.alpha/binding-form) :rest (? (cat :amp #{(quote &)} :form :cljs.core.specs.alpha/binding-form)) :as (? (cat :as #{:as} :sym :cljs.core.specs.alpha/local-name))),  Extra input
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: map?
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?

The salient aspect is that the complaint about c bubbles up to the top.

Show
Mike Fikes added a comment - After: For the particular example above, this involves Clojure generating the message, but after the change in ClojureScript, you can easily see the corresponding error update in self-hosted ClojureScript (in this case generated via Planck built with the change):
cljs.user=> (let [[a :as b c] [1 2 3]] a)
            ^
Call to cljs.core$macros/let did not conform to spec:
In: [0 0 3] val: (c) fails spec: :cljs.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: (cat :elems (* :cljs.core.specs.alpha/binding-form) :rest (? (cat :amp #{(quote &)} :form :cljs.core.specs.alpha/binding-form)) :as (? (cat :as #{:as} :sym :cljs.core.specs.alpha/local-name))),  Extra input
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: map?
In: [0 0] val: [a :as b c] fails spec: :cljs.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?
The salient aspect is that the complaint about c bubbles up to the top.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: