core.typed

Support metadata map and :arglists in clojure.core.typed/defn

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: 0.3.8, 0.3.x
  • Component/s: Clojure Checker
  • Labels:
    None
  • Patch:
    Code and Test

Description

Minimal example:

(clojure.core/defn f [])
(meta #'f)
;; => {:arglists ([]), ...}

(clojure.core.typed/defn g [])
(meta #'g)
;; => :arglists key missing completely

This is problematic, because g's arguments won't show up in its documentation via e.g. clojure.repl/doc
and I think lots of other tools assume that :arglists is there.

I've attached a patch that should fix this (and have also just signed Clojure's CA).

Pull request: 32
Patch: ctyp-168.patch (deleted a trailing whitespace)
Commit: 73d6be1
Release: 0.3.8

Activity

Hide
Ambrose Bonnaire-Sergeant added a comment -

Is your name on this list? http://clojure.org/contributing

Show
Ambrose Bonnaire-Sergeant added a comment - Is your name on this list? http://clojure.org/contributing
Hide
Ambrose Bonnaire-Sergeant added a comment -

Oh I see you just signed it. Let me know when your name pops up and I'll merge this. Thanks!

Show
Ambrose Bonnaire-Sergeant added a comment - Oh I see you just signed it. Let me know when your name pops up and I'll merge this. Thanks!
Hide
Ambrose Bonnaire-Sergeant added a comment -

I get some errors in the unit tests. Can you run `mvn test` and fix them please?

Show
Ambrose Bonnaire-Sergeant added a comment - I get some errors in the unit tests. Can you run `mvn test` and fix them please?
Hide
Tobias Kortkamp added a comment -

Found the problem and attached a new patch.
The tests pass now..

Show
Tobias Kortkamp added a comment - Found the problem and attached a new patch. The tests pass now..
Hide
Tobias Kortkamp added a comment -

I've attached an updated version of the patch that additionally adds attr-map support to defn. The tests still pass and it looks like my name appears on the contributors list now.

Show
Tobias Kortkamp added a comment - I've attached an updated version of the patch that additionally adds attr-map support to defn. The tests still pass and it looks like my name appears on the contributors list now.
Hide
James Reeves added a comment -

This would be useful to fix, otherwise docs aren't generated properly when using clojure.core.typed/defn.

Show
James Reeves added a comment - This would be useful to fix, otherwise docs aren't generated properly when using clojure.core.typed/defn.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: