:check-coverage reporting false-positive for declared >defn
Closed this issue · 2 comments
declare
calls seem to trip up coverage checking. When compiled, the following reports that "a" is not declared with >defn
.
(ns example.core
(:require [ghostwheel.core :as g, :refer [>defn =>]]))
(declare a)
(>defn a [x] [int? => int?]
(* x 2))
(g/check)
The problem here is that when you forward-declare a var like this it sort of masks its metadata in the var list in the namespace metadata which Ghostwheel uses to differentiate between defn
s and >defn
s and it can no longer tell the difference.
I'd rather have a false positive than a false negative here, but you can simply override the warning like you would for a regular plain defn
since 0.2.3:
(declare ^{::g/check-coverage false} a)
It's a bit of a hassle but since forward declarations aren't needed that often, it shouldn't be a big deal in practice.
Closing this for now but feel free to reopen it if this doesn't solve your problem.