technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Play nice with core.typed / :import?

seancorfield opened this issue · comments

Not quite sure where this one falls. We're using core.typed so we tend to have :import lines like this:

(:import (clojure.lang IDeref ISeq Keyword Seqable))

because it makes the type annotations read better. It seems that Slamhound attempts to eliminate the :import but it also triggers core.typed to actually run on the new code somehow and core.typed chokes because it can no longer resolve IDeref etc.

Here's the error output:

Failed to reconstruct: #<File src/worldsingles/payment/sbw.clj>
Internal Error (:<NO LINE>) Cannot resolve type: IDeref
Hint: Is IDeref in scope?
Hint: Has IDeref's annotation been found via check-ns, cf or typed-deps?

The first line in Slamhound, the next three are core.typed - failing to resolve IDeref after Slamhound has eliminated the :import?

I can provide more detail if needed but here's the core.typed line that fails in the above:

(ann ^:no-check worldsingles.environment/my-settings (IDeref (HMap)))

Changing that to this gets me further (I'll open a new bug for the next issue):

(ann ^:no-check worldsingles.environment/my-settings (clojure.lang.IDeref (HMap)))

Confirmed fixed - thank you!