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

Spec-tools compatibility: support IFn on records? #1386

Open
arichiardi opened this issue Oct 3, 2022 · 0 comments
Open

Spec-tools compatibility: support IFn on records? #1386

arichiardi opened this issue Oct 3, 2022 · 0 comments

Comments

@arichiardi
Copy link
Contributor

arichiardi commented Oct 3, 2022

Is your feature request related to a problem? Please describe.
I would like to make spec-tools compatible with babashka.

At the moment the namespaces are not loading because of this issue:

----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  defrecord/deftypecurrently only support protocol implementations, found: IFn
Data:     {:type :sci/error, :line nil, :column nil, :file "spec_tools/core.cljc"}
Location: spec_tools/core.cljc:396:1
Phase:    macroexpand

----- Context ------------------------------------------------------------------
392:     (if (sequential? type)
393:       (update spec :type (comp first second))
394:       spec)))
395: 
396: (defrecord Spec [spec form type]
     ^--- defrecord/deftypecurrently only support protocol implementations, found: IFn
397:   #?@(:clj [s/Specize
398:             (specize* [s] s)
399:             (specize* [s _] s)])
400: 
401:   Coercion

----- Stack trace --------------------------------------------------------------
clojure.core/defrecord                                                    - <built-in>
spec-tools.core/dorun                                                     - spec_tools/core.cljc:396:1
spec-tools.core                                                           - spec_tools/core.cljc:396:1
spec-tools.data-spec                                                      - spec_tools/data_spec.cljc:4:3
acuity.core3.models.clinical-configuration.contrast-agent-definition      - /home/cokap/git/cohesic/acuity/domain/src/acuity/core3/models/clinical_configuration/contrast_agent_definition.clj:2:3
... (run with --debug to see elided elements)
cognitect.test-runner/test                                                - /home/cokap/.gitlibs/libs/io.github.cognitect-labs/test-runner/dfb30dd6605cb6c0efc275e1df1736f6e90d4d73/src/cognitect/test_runner.clj:71:5
cognitect.test-runner/test                                                - /home/cokap/.gitlibs/libs/io.github.cognitect-labs/test-runner/dfb30dd6605cb6c0efc275e1df1736f6e90d4d73/src/cognitect/test_runner.clj:62:1
cognitect.test-runner                                                     - /home/cokap/.gitlibs/libs/io.github.cognitect-labs/test-runner/dfb30dd6605cb6c0efc275e1df1736f6e90d4d73/src/cognitect/test_runner.clj:127:38
clojure.core/apply                                                        - <built-in>
user-c31e592a-778b-4e5e-ac1b-4ce2f3522b90                                 - <expr>:26:1

Describe the solution you'd like
Basically something like the last commit of this fork should work. At least with what my code base contains.

Describe alternatives you've considered
I did fork, thanks for the suggestion.

@borkdude borkdude changed the title Spec-tools compatibility Spec-tools compatibility: support IFn on records? Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant