Uploaded image for project: 'Clojure'
  1. CLJ-2392

[spec] fspec role in problem path is not useful

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: Release 1.9
    • Fix versions: Release 1.10
    • Approval:
      Ok
    • Patch:
      Code

      Description

      Currently, spec function errors prepend the function "role" (really always :args) which creates a false first segment that is always there.

      user=> (let [a/b 1] b)
      CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/let did not conform to spec:
      In: [0 0] val: a/b fails spec: :clojure.core.specs.alpha/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
      In: [0 0] val: a/b fails spec: :clojure.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :seq] predicate: vector?
      In: [0 0] val: a/b fails spec: :clojure.core.specs.alpha/map-bindings at: [:args :bindings :binding :map] predicate: coll?
      In: [0 0] val: a/b fails spec: :clojure.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map] predicate: map?
      

      Note the "at: [:args ...]" - the :args here is manually inserted by spec problem reporting. It occurs on the path of every problem line report and thus does not add any information.

      Proposed: Remove the explicit "role" path.

      Patch: clj-2392.patch

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alexmiller Alex Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: