This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-28
Channels
- # beginners (45)
- # boot (4)
- # cider (5)
- # cljs-dev (8)
- # cljsrn (4)
- # clojure (38)
- # clojure-conj (7)
- # clojure-dev (4)
- # clojure-russia (3)
- # clojure-spec (20)
- # clojure-uk (3)
- # clojurescript (28)
- # core-logic (29)
- # figwheel-main (10)
- # fulcro (2)
- # onyx (1)
- # other-languages (5)
- # parinfer (3)
- # pathom (98)
- # portkey (1)
- # reagent (15)
- # reitit (9)
- # shadow-cljs (22)
- # spacemacs (10)
- # sql (22)
- # tools-deps (1)
I think it can only work for simple stuff, but the simple stuff can be pretty high impact - specifically just nullability
Perhaps we should try to do https://dev.clojure.org/jira/browse/CLJS-2946 prior to release as it would provide a workaround for https://dev.clojure.org/jira/browse/CLJS-2945 (Otherwise spec failures may not be very useful because they print with very little info.)
With the latest master
(require,'[clojure.spec.alpha,:as,s])
(require,'[clojure.spec.test.alpha,:as,stest])
(s/fdef clojure.core/merge
:args (s/cat :maps (s/* (s/nilable associative?)))
:ret (s/nilable associative?))
(stest/instrument `merge)
(merge) ;; should be nil, gives maximum call stack exceeded
clj -A:test -m cljs.main -re nashorn -i maximum-call-stack-exceeded.cljs
added to the JIRA ticket https://dev.clojure.org/jira/browse/CLJS-2942?focusedCommentId=50404#comment-50404
I see there’s already a ticket for it: https://dev.clojure.org/jira/browse/CLJS-2948
The lack of printing of spec error details on many REPL environments (https://dev.clojure.org/jira/browse/CLJS-2945) has an easy workaround that lessens this as an issue:
If you encounter a spec failure in a REPL, then *e
will be an ExceptionInfo
, which easily provides access to the desired ex-data
.