Uploaded image for project: 'ClojureScript'
  1. CLJS-2641

cljs.spec.alpha/fdef with s/* is broken

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Completed
    • Affects versions: 1.10.238
    • Fix versions: None
    • Labels:
    • Environment:

      1.10.145

      Description

      In ClojureScript 1.10.145, the code below exceeds the call stack on the first call to foo. In ClojureScript 1.9.946 it works as expected (throws a spec exception on the second call to foo).

      (ns foo.spec-instrument-test
        (:require [cljs.spec.alpha :as s]
                  [cljs.spec.test.alpha :as stest]))
      
      (enable-console-print!)
      
      (defn foo [& args] (prn :got args))
      (s/fdef foo :args (s/cat :args (s/* int?)))
      
      (stest/instrument)
      (foo 1 2 3)
      (foo 1 :hello)
      
      RangeError: Maximum call stack size exceeded
          at cljs.core.next (/Users/miikka/mess/2018-10/foo/out/main.js:526:476)
          at cljs.spec.alpha.deriv (/Users/miikka/mess/2018-10/foo/out/main.js:3698:381)
          at cljs.spec.alpha.re_conform (/Users/miikka/mess/2018-10/foo/out/main.js:3727:23)
          at undefined.cljs.spec.alpha.t_cljs$spec$alpha9065.cljs.spec.alpha.t_cljs$spec$alpha9065.cljs$spec$alpha$Spec$conform_STAR_$arity$2 (/Users/miikka/mess/2018-10/foo/out/main.js:3735:93)
          at cljs.spec.alpha.conform_STAR_ (/Users/miikka/mess/2018-10/foo/out/main.js:3433:117)
          at cljs.spec.alpha.conform (/Users/miikka/mess/2018-10/foo/out/main.js:3457:264)
          at /Users/miikka/mess/2018-10/foo/out/main.js:3806:485
          at Function.e [as cljs$core$IFn$_invoke$arity$variadic] (/Users/miikka/mess/2018-10/foo/out/main.js:3810:355)
          at Function.foo.spec_instrument_test.foo.cljs$lang$applyTo (/Users/miikka/mess/2018-10/foo/out/main.js:3850:316)
          at Function.cljs.core.apply.cljs$core$IFn$_invoke$arity$2 (/Users/miikka/mess/2018-10/foo/out/main.js:899:190)
      

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              arcatan Miikka Koskinen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: