technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

defrecord/deftype namespaces not properly required

bostonaholic opened this issue · comments

The namspace of a defrecord/deftype must also be required.

See the following example:

src/my/domain/file_header.clj

(ns my.domain.file-header)

(defprotocol Whatever
  ...)

(defrecord FileHeader [args]
  Whatever
  ...)

my/domain/core.clj

(ns my.domain.core
  (:require [my.domain.file-header :refer :all])
  (:import (my.domain.file_header FileHeader))

But slamhound is forgetting the :require piece. The same goes for deftype.

Hello, thank you for reporting!

Yes, this is an oversight. This escaped my notice because I either always AOT compile my artifacts or the necessary namespace just happens to be required to satisfy other unqualified references.

I'll take a look at this today.

Hello,

I believe this fixes the issue. Please re-open if you find any errors.

Thank you!

When is the next planned release?

I'll make one today if @technomancy agrees.

Sounds good to me; thanks @guns.

Okay 1.5.1 is live on clojars! Happy hacking.

Awesome! Looks like it's working. Thanks.