core.typed

Apply doesn't work with dotted arguments

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

This code:

(t/ann foo (All [x y ...] [[y ... y -> x] -> [y ... y -> x]]))
(defn foo
  "Doesn't do anything useful."
  [f]
  (let [mem (memoize (fn [& args] #(apply f args)))]
    (fn [& args]
      ((apply mem args)))))

On type-check throws this exception:

AssertionError Assert failed: (not (some :drest (:types fin)))  clojure.core.typed.check/relevant-Fns (check.clj:2661)

I'm using core.typed version 0.2.36.

Activity

Ambrose Bonnaire-Sergeant made changes -
Field Original Value New Value
Summary Apply doesn't work with variadic something Apply doesn't work with dotted arguments
Di Xu made changes -
Attachment apply.diff [ 12954 ]
Di Xu made changes -
Comment [ actually, I think this isn't the fault of `apply`, I got same error:

    user=> (t/cf (fn [x & y] x) (All [x y ...] [x y ... y -> x])) ]
Ambrose Bonnaire-Sergeant made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Ambrose Bonnaire-Sergeant made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: