Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong pre-post on valid pre/post-condition #219

Closed
jmromrell opened this issue May 8, 2017 · 0 comments
Closed

wrong pre-post on valid pre/post-condition #219

jmromrell opened this issue May 8, 2017 · 0 comments

Comments

@jmromrell
Copy link

(defn myfn [data]
  {:pre [(spec/assert ::my-spec data)]}
  ...)

gives me the following error in eastwood:

dbg wrong-pre-post: condition=(spec/assert :myns.myfn/data data) line=43 test-ast :op=:if

Alex Miller (one of the maintainers of Clojure) suggests that it is fine to use spec/assert within a pre/post-condition here: https://groups.google.com/forum/#!topic/clojure/H9tk04sSTWE It also has the benefit of being able to be toggled by env settings in the profile, so it can be easily disabled for performance in production environments, where unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants