core.typed

Can't use polymorphic records

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
  • Environment:
    core.typed 0.2.36

Description

The following code fails at load time with CompilerException clojure.lang.ArityException: Wrong number of args (0) passed to: errors/int-error, compiling:

(ns polymorphic.records                                                                                                                                                                                  
  (:require [clojure.core.typed :as t]))                                                                                                                                                            

(t/ann-record [[t :variance :invariant]]                                                                                                                                                            
              Collector                                                                                                                                                                             
              [coll :- (t/Coll t)])                                                                                                                                                                 
(defrecord Collector [coll])                                                                                                                                                                        

(t/ann collector-maker                                                                                                                                                                              
       (TFn [t] [(t/Coll t) -> (Collector t)]))                                                                                                                                                     
(defn collector-maker                                                                                                                                                                               
  [coll]
  (->Collector coll))

Activity

Ambrose Bonnaire-Sergeant made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Ambrose Bonnaire-Sergeant made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: