arohner / spectrum

Other
595 stars 20 forks source link

spectrum.conform/protocol- did not conform to spec: clojure.core/inst-ms* #33

Open jc776 opened 5 years ago

jc776 commented 5 years ago

I did 'lein install' on Unifier fixes and tests locally due to #29.

I get an error when loading spectrum.check:

(ns worksheet.type-specs
  (:require [spectrum.check :as check]))
java.lang.ClassNotFoundException: spectrum.protocols.Logic, compiling:(spectrum/conform.clj:1:1)

I patched this by adding (defrecord Logic [name]) to the bottom of protocols.clj. I then tried the example in the README:

(check/type-of '(map inc (range 5)))
loading clojure
evaling (ns clojure.core)
analyzing #object[java.net.URL 0x12d10201 jar:file:/C:/Users/Jack/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar!/clojure/core_proxy.clj]
evaling (in-ns (quote clojure.core))
analyzing #object[java.net.URL 0x656ca907 jar:file:/C:/Users/Jack/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar!/clojure/core_print.clj]
evaling (in-ns (quote clojure.core))
analyzing #object[java.net.URL 0x3452788d jar:file:/C:/Users/Jack/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar!/clojure/genclass.clj]
evaling (in-ns (quote clojure.core))
analyzing #object[java.net.URL 0x5dab3f14 jar:file:/C:/Users/Jack/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar!/clojure/core_deftype.clj]
evaling (in-ns (quote clojure.core))
analyzing #object[java.net.URL 0x557031f9 jar:file:/C:/Users/Jack/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar!/clojure/core/protocols.clj]
evaling (ns clojure.core.protocols)
analyzing #object[java.net.URL 0x9862fc4 jar:file:/C:/Users/Jack/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar!/clojure/gvec.clj]
evaling (in-ns (quote clojure.core))
analyzing #object[java.net.URL 0x690e0a70 jar:file:/C:/Users/Jack/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar!/clojure/instant.clj]
evaling (ns clojure.instant (:import [java.util Calendar Date GregorianCalendar TimeZone] [java.sql Timestamp]))
Exception thrown: clojure.lang.ExceptionInfo (Spec assertion failed.)

*e
#error {
 :cause "Call to #'spectrum.conform/protocol- did not conform to spec:\nIn: [0] val: #'clojure.core/inst-ms* fails at: [:args :p] predicate: protocol?\r\n"
 :data {:clojure.spec.alpha/problems [{:path [:args :p], :pred spectrum.util/protocol?, :val #'clojure.core/inst-ms*, :via [], :in [0]}], :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2436 0x46ef9602 "clojure.spec.alpha$regex_spec_impl$reify__2436@46ef9602"], :clojure.spec.alpha/value (#'clojure.core/inst-ms*), :clojure.spec.alpha/args (#'clojure.core/inst-ms*), :clojure.spec.alpha/failure :instrument, :clojure.spec.test.alpha/caller {:file "flow.clj", :line 327, :var-scope spectrum.flow/protocol-method-args-bindings}}
 :via
 [{:type clojure.lang.ExceptionInfo
   :message "Call to #'spectrum.conform/protocol- did not conform to spec:\nIn: [0] val: #'clojure.core/inst-ms* fails at: [:args :p] predicate: protocol?\r\n"
   :data {:clojure.spec.alpha/problems [{:path [:args :p], :pred spectrum.util/protocol?, :val #'clojure.core/inst-ms*, :via [], :in [0]}], :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2436 0x46ef9602 "clojure.spec.alpha$regex_spec_impl$reify__2436@46ef9602"], :clojure.spec.alpha/value (#'clojure.core/inst-ms*), :clojure.spec.alpha/args (#'clojure.core/inst-ms*), :clojure.spec.alpha/failure :instrument, :clojure.spec.test.alpha/caller {:file "flow.clj", :line 327, :var-scope spectrum.flow/protocol-method-args-bindings}}
   :at [clojure.core$ex_info invokeStatic "core.clj" 4739]}]

Also, I get a second error when loading spectrum.unify. I'm not sure whether it should be c/logic? or the logic? in this file.

(require '[spectrum.flow2 :as f2])
java.lang.RuntimeException: Unable to resolve symbol: logic? in this context, compiling:(spectrum/unify.clj:12:5)
divs1210 commented 5 years ago

This looks outdated. spectrum.check loads fine for me, and doesn't seem to house a fn called type-of. lein install was successful.