typechecking with closed source (datomic)?

47 views
Skip to first unread message

Allen Rohner

unread,
Jul 30, 2014, 7:05:41 PM7/30/14
to clojure-c...@googlegroups.com
(ns foo.bar
  (:require [datomic.api :as d]
               [clojure.core.typed :as t]))

=> (t/check-ns 'foo.bar)

Start collecting foo.bar
Type Error (NO_SOURCE_FILE) Internal Error (:<NO LINE>) File for datomic.api not found on classpath: datomic/api.clj
ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.clj:4403)


Because datomic is closed-sourced, I won't have have a datomic.api.clj on my classpath. Is there a workaround?

Ambrose Bonnaire-Sergeant

unread,
Jul 31, 2014, 12:37:38 AM7/31/14
to core.typed
Hi Allen,

No workaround currently.

Any suggestions?

I guess we could fail silently and continue type checking, or have extra
ns options like:

(ns foo.bar
  {:core.typed {:ignore-ns [datomic.api]}}
  (:require [datomic.api :as d]
               [clojure.core.typed :as t]))


Thanks,
Ambrose

Allen Rohner

unread,
Jul 31, 2014, 11:18:13 AM7/31/14
to clojure-c...@googlegroups.com
My first thought is to continue checking, with a warning like "couldn't find datomic/api.clj on classpath". In my head, I've always thought of the contract as "core.typed will check namespaces that depend on core.typed." datomic.api doesn't require core.typed, so it makes sense that it shouldn't be checked. 
Reply all
Reply to author
Forward
0 new messages