[CLJ-1308] extend-type doesn't type-hint correctly as promised by the doc when the class is determined at run-time Created: 15/Dec/13 Updated: 06/Jan/15
extend-type works with non-constant expressions as its type:
However, in this case this will get tagged with `(class 1)`, which is clearly wrong; the doc explicitely states that the args will be proberly type-hinted: "[..] Propagates the class as a type hint on the first argument of all fns."
I don't know if extend-type is not supposed to work with non-constant Classes, in which case it should be stated in the doc or if the current behaviour is wrong.
|Comment by Andy Fingerhut [ 06/Jan/15 4:37 PM ]|
Eastwood as of around version 0.2.1 (or maybe have to wait until not-yet-released 0.2.2) will warn about such incorrect tags, if the :wrong-tag linter is enabled – it is by default. The section of Eastwood's documentation on this linter has a subsection specifically on extend-type and extend-protocol, primarily written so Andy can have a place to refer to this later after he forgets the details again.
(you have to scroll down a page or two to get to the subsection on extend-type / extend-protocol)