<< Back to previous view

[CTYP-83] check-ns takes exponentially longer on each invocation Created: 04/Oct/13  Updated: 15/Feb/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Blocker
Reporter: Hugo Duncan Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Running `(check-ns pathological)` repeatedly on the following namespace, `check-ns` takes longer and longer to complete.

(ns pathological
  (:require
   [clojure.core.typed :refer [ann def-alias loop>
                               NonEmptyVec NilableNonEmptySeq]]))

(def-alias VersionVector (NonEmptyVec Number))
(ann version-less [(U nil VersionVector) (U nil VersionVector) -> boolean])
(defn version-less
  "Compare two version vectors."
  [v1 v2]
  (loop> [v1 :- (NilableNonEmptySeq Number) (seq v1)
          v2 :- (NilableNonEmptySeq Number) (seq v2)]
    (let [fv1 (first v1)
          fv2 (first v2)]
      (cond
       (and (not v1) (not v2)) false
       (and v1 (not v2)) false
       (or (and (not v1) v2)
           (and fv1 fv2 (< fv1 fv2))) true
           (and fv1 fv2 (> fv1 fv2)) false
           :else (recur (next v1) (next v2))))))





[CTYP-108] core.typed runs forever Created: 20/Feb/14  Updated: 20/Feb/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Blocker
Reporter: Cees van Kemenade Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File infinite2.clj    

 Description   

The core.typed checkers runs forever on my files. I've added markers to pinpoint the problem (unchecked functions are mentioned on the standard-output). Thus I was able to prune my failing file to a fairly minimal test-case that runs forever.

I would be nice if (check-ns) had an option to output logging/information for each function that is checked. As this would save significant time in pin-pointing where core.typed stagnates.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 20/Feb/14 11:10 AM ]

Thanks for the report. Hangs for me too.

core.typed logs each line it's checking if you call check-ns like this:

(check-ns ns :trace true)

Comment by Ambrose Bonnaire-Sergeant [ 20/Feb/14 11:16 AM ]

This is the minimum case: https://gist.github.com/frenchy64/9118729

Related to http://dev.clojure.org/jira/browse/CTYP-83





[CTYP-27] clojure.lang.RT/nth's type doesn't currently allow nil as the first argument Created: 23/Jul/13  Updated: 27/Jul/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Alan Busby Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Re: Why (first [1 2 3]) isn't equivalent to (let [[x & xs] [1 2 3]] x)
"
; This is because clojure.lang.RT/nth's type doesn't currently allow nil as
; the first argument. Should be fixed in master, but please submit a bug report to
; JIRA, it might not be completely correct.
; -Ambrose"

From
https://github.com/frenchy64/type-examples/blob/master/src/type_examples/core.clj

I'm not sure if this is fixed in master, but I couldn't build the current 0.1.18-SNAPSHOT (master) to check.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 23/Jul/13 6:09 AM ]

Sorry, master is a bit broken at the moment. It may take a week to get it stable actually!

Comment by Ambrose Bonnaire-Sergeant [ 27/Jul/13 9:41 AM ]

This needs a special case for invoke-nth, to handle things like (nth (I (Seqable x) (CountRange 1)) 0).





[CTYP-31] Error with unannotated datatypes. Created: 23/Jul/13  Updated: 23/Jul/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Alan Busby Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

[org.clojure/core.typed "0.1.17"]



 Description   

From mail;
> > > Hmm. Is LocalConnection a datatype? What's the error you get?
> >
> > This: (t/ann ^:nocheck datomic.api/connect [String -> datomic.peer.LocalConnection])
> > Produces: AssertionError Assert failed: ((u/array-map-c? symbol? (some-fn Scope? Type?)) fields) clojure.core.typed.type-rep/->DataType (type_rep.clj:265)
>
> Thanks.
>
> core.typed doesn't like unannotated datatypes right now. This is probably a defect, please open a ticket.






[CTYP-32] Cannot instantiate variables that have bounds Created: 29/Jul/13  Updated: 29/Jul/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Trying to implement this example: http://www.scala-lang.org/node/136

The result: core.typed doesn't know that other bounded type variables can be substituted.

https://gist.github.com/frenchy64/6110077






[CTYP-35] Should use fresh names when checking plambdas Created: 26/Aug/13  Updated: 26/Aug/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

See the Typed Racket implementation. Poly-fresh* is only needed when checking a plambda.

ambrosebs: why is Poly-fresh: needed in the plambda type checking code, but nowhere else?
asumu: ambrosebs: that's the only place where the body of the lambda is checked.
asumu: The only purpose of Poly-fresh is to make sure the references to the bound type variable in the body are resolved in the correct way.
asumu: When the type is just manipulated otherwise, it doesn't matter.






[CTYP-39] def-alias not working in ClojureScript Created: 02/Sep/13  Updated: 02/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chris Frisz Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: cljs
Environment:

Safari 6.0.5 and Firefox 22.0 on Mac OS X 10.8.4



 Description   

Using def-alias results in a runtime JavaScript exception, possibly indicating that it's not implemented.

Safari: TypeError: 'undefined' is not an object (evaluating 'cljs.core.typed.def_alias_STAR_')
Firefox: [13:58:34.654] TypeError: cljs.core.typed is undefined @ http://localhost:3000/js/chaser.js:21780






[CTYP-47] Expected: IFn, Actual (Fn [Any -> Any]) Created: 05/Sep/13  Updated: 09/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: André Thieme Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: jfx


 Description   
Unable to find source-code formatter for language: clojure. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
(def-alias Promise (clojure.lang.IDeref Any))
(ann ^:no-check clojure.core/promise [-> Promise])
(ann ^:no-check clojure.core/deliver (All [t] [Promise t -> t]))

(ann primary-stage Stage)
(defonce ^Stage primary-stage
  (when-not *compile-files*
    (let [s (promise)]
      (SplendidJFX/launchApplication (fn> [x :- Any] (deliver s x)))
      @s)))

When doing (check-ns) it results in an unexpected error:
Type Error (splendid.jfx:27:7) Type mismatch:
Expected: IFn
Actual: (Fn [Any -> Any])
in: (splendid.SplendidJFX/launchApplication (clojure.core.typed/fn>-ann (fn* (# #)) (quote (#))))



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 07/Sep/13 8:51 AM ]

Confirmed. This needs a little work and refactoring to fix.

Comment by Ambrose Bonnaire-Sergeant [ 08/Sep/13 6:29 AM ]

Related: http://dev.clojure.org/jira/browse/CTYP-16

Comment by Ambrose Bonnaire-Sergeant [ 09/Sep/13 12:28 PM ]

Design work happening here: http://dev.clojure.org/display/design/Cleaning+up+Type+Syntax





[CTYP-48] Internal error: keyword invoke gave bottom type Created: 06/Sep/13  Updated: 06/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Invoking keyword keys on things that are not maps, or maps that don't have the "correct" keys throws an internal type error. This should be a warning and return Any.

https://groups.google.com/forum/#!topic/clojure-core-typed/Jl2eIJjJCIE



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 06/Sep/13 11:06 PM ]

Fixed in master: https://github.com/clojure/core.typed/commit/26166595addde1d97d96db57baf154c3e19330c6

Verify with version:

[org.clojure/core.typed "0.2.5-20130907.040255-3"]
:repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}





[CTYP-49] Applying flow filter resulted in local being bottom Created: 07/Sep/13  Updated: 08/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Close to minimal case: https://gist.github.com/pnf/e208b0d44860aedc9c9d



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 08/Sep/13 1:39 AM ]

Can't reproduce this particular report, however the flow filter error probably needs to be fixed.

https://gist.github.com/anonymous/6482420

Comment by Ambrose Bonnaire-Sergeant [ 08/Sep/13 6:22 AM ]

Added test to verify this. https://github.com/clojure/core.typed/commit/f96d74a76fe72d26c06b1648df424f5314aa7cad

The general problem of the flow filter error still needs addressing.





[CTYP-50] Support overriding fields Created: 09/Sep/13  Updated: 09/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Give the user tools to give better types to Java fields.






[CTYP-51] assoc unsupported in CLJS Created: 10/Sep/13  Updated: 10/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chris Frisz Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

ClojureScript 0.0-1859, Mac OS X 10.8.4



 Description   

Simple snippet of code that exemplifies the defect:

(ann update-first [(Vector* number number) number -> (Vector* number number)])
(defn update-first [my-vec new-first] (assoc my-vec 1 new-first))






[CTYP-52] Heterogeneous Vector is not ISeqable in CLJS Created: 10/Sep/13  Updated: 10/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chris Frisz Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

ClojureScript 0.0-1859, Mac OS X 10.8.4



 Description   

Following code snipped exemplifies the error:

(ann update-first [(Vector* number number) number -> (Vector* number number)])
(defn update-first [my-vec new-first] (assoc my-vec 1 new-first))

Produces the following error when type-checking:

Type Error [file] Polymorphic function clojure.core/nth could not be applied to arguments:
Polymorphic Variables:
x
y

Domains:
(U (cljs.core/ISeqable x) nil) int
(U (cljs.core/ISeqable x) nil) int y

Arguments:
chaser-cljs.coords/CoordsT (Value 1) nil

Ranges:
x
(U y x)

in: (clojure.core/nth vec__8823 1 nil)
in: (clojure.core/nth vec__8823 1 nil)






[CTYP-54] Merge compatible types to make more accurate ones Created: 11/Sep/13  Updated: 11/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

We need to figure out how to merge types like (I (Vec Any) (Seqable Number)). A general solution is probably needed: we want a way for new types to "plug in" to this behaviour.

This needs to be considered in Clojurescript too, where Vec and Seqable are implemented as protocols and do not have an inheritance relationship.

(From https://gist.github.com/pnf/e208b0d44860aedc9c9d)

;; There seems to be some difficulty in merging the two assertions here.
(t/ann testassert6 [(t/Vec Any) -> (t/Vec t/AnyInteger)])
(defn testassert6 [m]
(assert (vector? m)) ; this should be redundant
(assert (every? integer? m))
m)
;; Type Error (imdb.testassert:92) Local binding m expected type (t/Vec t/AnyInteger), but actual type (I (IPersistentVector Any) (t/Coll t/AnyInteger))
;; in: m
;; Type Error (imdb.testassert:92) Type mismatch:
;; Expected: (t/Vec t/AnyInteger)
;; Actual: (I (IPersistentVector Any) (t/Coll t/AnyInteger))
;; in: (do (if (clojure.core/vector? m) nil (throw (new java.lang.AssertionError #))) (if (clojure.core/every? clojure.core/integer? m) nil (throw (new java.lang.AssertionError #))) m)
;; Type Error (imdb.testassert:92:1) Type mismatch:
;; Expected: (Fn [(t/Vec Any) -> (t/Vec t/AnyInteger)])
;; Actual: (Fn [(t/Vec Any) -> (I (IPersistentVector Any) (t/Coll t/AnyInteger)) :filters {:then (& (is (IPersistentVector Any) 0) (! (U nil false) 0)), :else (is (U nil false) 0)} :object {:id 0}])
;; in: (def testassert6 (fn* ([m] (do # # m))))






[CTYP-57] Support monitor-enter/monitor-exit Created: 13/Sep/13  Updated: 13/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None





[CTYP-63] ann-record should accept optional binder Created: 16/Sep/13  Updated: 16/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

ann-precord should be deprecated and consolidated with ann-record.






[CTYP-70] Having trouble typing core.string/blank? Created: 24/Sep/13  Updated: 28/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: 0.2.0
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Julian Birch Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

(ns moonrise
(:require [clojure.core.typed :refer :all]
[clojure.string :as s]))

(cf (ann core.string/blank? [String -> Boolean]))

(ann x [String -> Boolean])
(defn x [s] (s/blank? s))

Fails.

Apologies if this is wrong.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 25/Sep/13 3:12 AM ]

I think core.string/blank? should be clojure.string/blank?. Also cf is not allowed inside a typed file.

Comment by Julian Birch [ 28/Sep/13 2:58 PM ]

Clunk. You're absolutely right. Assuming there's no (cf) there, is there any way you could log an error for an annotation with no associated actual definition? Obviously, to be useful, it'd have to appear in the appropriate location in the file.

Comment by Ambrose Bonnaire-Sergeant [ 28/Sep/13 10:16 PM ]

I don't know. Perhaps at the end of type checking a namespace I can check if a var exists for each annotation. I don't think it's really feasible for REPL development though.





[CTYP-71] Occurrence typing does not deal well with non-eagerly simplifying unions Created: 26/Sep/13  Updated: 26/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Bug introduced in 0.2.11.

(cf (fn> [a :- (U nil (Nilable java.util.Date))]
(when a
(ann-form a java.util.Date))))

Type Error (clojure.core.typed:1:87) Local binding a expected type java.util.Date, but actual type (U (Nilable java.util.Date) nil)
in: a

Type Error (clojure.core.typed:1:87) Type mismatch:

Expected: java.util.Date

Actual: (U (Nilable java.util.Date) nil)
in: a

ExceptionInfo Type Checker: Found 2 errors clojure.core/ex-info (core.clj:4327)






[CTYP-72] merge doesn't seem to like records Created: 28/Sep/13  Updated: 28/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: 0.2.0
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Julian Birch Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I'm pretty sure this should pass

(ns moonrise
(:require [clojure.core.typed :refer :all]))

(ann-record X [a :- Number])
(defrecord X [a])

(ann x X)
(def x (merge (X. 3) {:z 4}))

but it gives

Type Error (moonrise:8:8) Polymorphic function clojure.core/merge could not be applied to arguments:
Polymorphic Variables:
k
v

Domains:
nil *
(clojure.lang.IPersistentMap k v) (clojure.lang.IPersistentMap k v) *
(Option (clojure.lang.IPersistentMap k v)) *

Arguments:
moonrise.X (HMap :mandatory {:z (Value 4)} :complete? true)

Ranges:
nil
(clojure.lang.IPersistentMap k v)
(Option (clojure.lang.IPersistentMap k v))

with expected type:
moonrise.X

in: (clojure.core/merge (new moonrise.X 3) (quote {:z 4}))
in: (def x (clojure.core/merge (new moonrise.X 3) (quote {:z 4})))

Type Checker: Found 1 error






[CTYP-75] More accurate Long arithmetic Created: 30/Sep/13  Updated: 30/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Chris Spencer Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File better-arithmetic.patch     Text File long-arithmetic.patch    

 Description   

The basic operations +*- do not autopromote, so it's safe to assume that an operation on Longs will remain a Long (or throw an exception)



 Comments   
Comment by Chris Spencer [ 30/Sep/13 3:55 AM ]

Attached better-arithmetic which supersedes the other patch. Adds better type preservation/inference for Longs and Doubles through arithmetic.





[CTYP-80] Issue with filter subtyping/simplification Created: 02/Oct/13  Updated: 02/Oct/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I think I broke this with the 0.2.11 changes to union.

http://paste2.org/kWVNZxC7






[CTYP-81] clojure.core.async/alts!! fails to check when used with any keyword arguments Created: 03/Oct/13  Updated: 03/Oct/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Michael Hanson Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

clojure.core.typed 0.2.13



 Description   

Using alts!! as (alts!! [(chan) (chan)] :priority true) or (alts!! [(chan) (chan)] :priority true :default nil) fails to check, stating that an uneven number of keyword arguments were provided to the function. Removing the keyword arguments checks :ok.

See https://gist.github.com/mybuddymichael/f584ab905a4165f273e6 for the simple test case and repl output.






[CTYP-87] Handle variace in datatype cgen Created: 15/Oct/13  Updated: 15/Oct/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/cs_gen.clj#L739






[CTYP-88] with-meta doesn't type check with vectors or hash-maps. Created: 16/Oct/13  Updated: 16/Oct/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Russell Mull Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

clojure 1.5.1
core.typed 0.2.13



 Description   
(cf (with-meta 'a {})) 
;; => (Value a)  ; expected result

(cf (with-meta [] {}))
;; => AssertionError Assert failed: 1: Inferred type [] is not between bounds Nothing and clojure.lang.IObj
(and (subtype? inferred upper-bound) (subtype? lower-bound inferred))  clojure.core.typed.cs-gen/subst-gen/fn--10379 (cs_gen.clj:1333)

This also fails with an empty hash-map literal. Lists and sets work.






[CTYP-97] 0.2.16 seems to introduce a bug Created: 14/Nov/13  Updated: 18/Mar/14

Status: Reopened
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: kshramt Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

core.typed 0.2.16 and later



 Description   

Some changes introduced by core.typed-0.2.16 seems to cause `Type Error (sicp.err:49:13) Cannot resolve type: a` for following code.

0.2.15: :ok
0.2.16: error
0.2.17: error
0.2.18: error
0.2.19: error

$ lein typed check sicp.err
Initializing core.typed ...
Loading Clojurescript...
Clojurescript not found
"Elapsed time: 3130.848 msecs"
core.typed initialized.
Start collecting sicp.err
Finished collecting sicp.err
Collected 1 namespaces in 3293.048 msecs
Start checking sicp.err
Type Error (sicp.err:49:13) Cannot resolve type: a
Hint: Is a in scope?
Hint: Has a's annotation been found via check-ns, cf or typed-deps?
Found errors
Subprocess failed
(ns sicp.err
  (:require [clojure.test :refer [is are]]
            [clojure.core.typed :refer [ann fn>
                                        Seqable] :as typed])
  (:import (clojure.lang ASeq LazySeq)))


(ann reduce_ (All [a b] (Fn [[a b
                              -> b]
                             b
                             (Seqable a)
                             -> b]
                            [[a (Seqable (U a b))
                              -> (Seqable (U a b))]
                             (Seqable (U a b))
                             (Seqable a)
                             -> (Seqable (U a b))])))
(defn reduce_
  {:test #(do (is (= (reduce_ +' 0 [1 2]) 3))
              (is (= (reduce_ / 1 [2 3]) 2/3)))}
  [f zero coll]
  (if-let [s (seq coll)]
    (f (first s)
       (reduce_ f zero (rest s)))
    zero))

(ann append_ (All [a b] [(Seqable a) (Seqable b) -> (U (Seqable (U a b))
                                                       (ASeq (U a b)))]))
(defn append_
  [coll1 coll2]
  (reduce_ cons coll2 coll1))


; -------- main

; if you comment out this function, you will get :ok
(ann map-1 (All [a b] [[a -> b] (Seqable a)
                       -> (LazySeq b)]))
(defn map-1 [f coll]
  (lazy-seq
   (if-let [s (seq coll)]
     (cons (f (first s))
           (map-1 f (rest s))))))

(ann map-2 (All [a b] [[a -> b] (Seqable a) -> (LazySeq b)]))
(defn map-2
  [f coll]
  (lazy-seq
   (reduce_ (fn> [x :- a ; ERROR!! -- Cannot resolve type: a
                  y :- (Seqable b)]
              (append_ [(f x)] y))
            []
            coll)))


 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 14/Nov/13 7:58 PM ]

Ah, that's not surprising. I overhauled the scoping for type variables, forgot this case.

Thanks for the report.

Comment by vladimir [ 18/Mar/14 12:55 PM ]

Hello,

still got the same on 0.2.38.. is it closed because fixed?

Regards,

Vladimir

Comment by Ambrose Bonnaire-Sergeant [ 18/Mar/14 1:18 PM ]

Added passing test for CTYP-97 https://github.com/clojure/core.typed/commit/614244afc482826b650e0ebd14892f0ebbc411a0

Comment by Ambrose Bonnaire-Sergeant [ 18/Mar/14 1:19 PM ]

Vladimir,

Please elaborate on your issue.

Thanks
Ambrose





[CTYP-98] Implement a defrecord> macro Created: 23/Nov/13  Updated: 03/Dec/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Reid McKenzie Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File defrecord    

 Description   

In the interests of rendering c.c.t code more concise, implement a defrecord> macro wraping defrecord and ann-record.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 03/Dec/13 12:57 PM ]

There is another case I would like to consider: specifying polymorphic ancestors. Currently ann-datatype/ann-record take an undocumented keyword argument :unchecked-ancestors.

eg.

(ann-protocol [[x :variance :invariant]] Foo
  -foo
  [(Foo x) -> x])
(defprotocol> Foo
  (-foo [this]))

(ann-datatype DTFoo [m :- Any]
  :unchecked-ancestors [(Foo String)])
(deftype DTFoo [m]
  ; this next line might read (Foo String), instead of :unchecked-ancestors entry
  Foo
  (-foo [this] "a"))

I will revisit this issue once I've ironed out how :unchecked-ancestors should work.





[CTYP-100] RClass ancestors should work with reset-env Created: 09/Dec/13  Updated: 09/Dec/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None





[CTYP-102] large hashmaps: failure to discover subtype and error-output to complex to understand Created: 02/Feb/14  Updated: 03/Feb/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Cees van Kemenade Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: error-reporting, hash-map
Environment:

core.typed 0.2.25


Attachments: File longOutput.clj     File show-error.output    

 Description   

I am applying core.typed to a project that processes sequences of fairly large hash-maps. I run into two issues:
1. The error output is to large to be interpreted by a human (4k per error)
2. The reported error seems to be incorrect as the expected-type and actual type seem to match.

I came to this conclusion by writing a function that compared the expected type and the actuals type. This function is included too and might be an example of how to produce more compact and readible output for errors on large hash-maps.

The longOutput.clj contains the function that fails (derive-sms_msg-fmt-fail ..) and the nearly similar function (derive-sms_msg-fmt ..) that passes (check-ns).

The file also contains function (show-error) which prints a copy of the type-error and subsequently analyses the derived type with the expected type. The derived type is a union of the expected type and some derivatives based on the inclusion of optional keys. So I as far as I can see the union is subtype of the expected type and the reported error is incorrect.

An example of the error-analysis is included in the file show-error.output.



 Comments   
Comment by Cees van Kemenade [ 03/Feb/14 2:40 AM ]

PS: I could imagine that the current (show-error ..) could service as a basis for more compact error-messages on large hashmaps (using length of output as a criterium to decide whether the current error-format or the diffence-analysis results in the most compact error-report).

PS: I strongly believe in the big advantages of a static type-checker. But with the current error-messages it is nearly impossible to migrate a project involving large hash-maps due to the volumunuous error-output.

Comment by Ambrose Bonnaire-Sergeant [ 03/Feb/14 11:00 PM ]

Hi Cees,

Thanks for the detailed report, it really helps. I'll look into this.





[CTYP-106] Else branch does not tighten scope to non-sequential Created: 19/Feb/14  Updated: 20/Feb/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Cees van Kemenade Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File failDerive1a.clj     File failDerive1.clj    

 Description   

This error is related to the example longOptions.clj of CTYPE-102 and the derived hmap/big-options mentioned as CTYPE-99. I've prepared a new example to clearly show the issue.

The first function passes type-checking. However, it contains a redundant check on line 83 and a redundant base-case on line 85.

The second function does not pass the (check-ns) as it assumes that notifs can be a (seqable String). However, as this is the else-branch of line 112 (if (or (sequential? notifs) (seq? notifs) (vector notifs)) ... so the notifs can not be a (Seqable String) in this branch.

NOTE: core.typed does not know clojure.core/sequential? yet. Therefore the seq? and vector? tests are added too.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 19/Feb/14 5:03 AM ]

Seqable doesn't extend Sequential, ISeq or IPersistentVector, so it's expected that this fails.

I suspect that the type for :st_notif is always an immutable clojure collection? If so, annotate :st_notif as (U (t/Coll String) String nil), and use (coll? notifs) as the predicate. Otherwise, try (not (string? notifs)) as the predicate.

Comment by Cees van Kemenade [ 19/Feb/14 2:18 PM ]

I tried to turn it into clojure.core.typed/Coll and that worked fine.
Thanks for the suggestion/solution!

Out of curiosity I tried as an alternative to check for (= (class notifs) clojure.lang.Seqable) as a second solution, but that did not solve the issue.
So I will stick to solution 1.

Comment by Ambrose Bonnaire-Sergeant [ 19/Feb/14 7:21 PM ]

= isn't useful for narrowing types, especially in the else branch. instance? and isa? would be more useful.

Comment by Cees van Kemenade [ 20/Feb/14 9:48 AM ]

Sorry, it was a typo from my side. I used (isa? ....) see line 166 of the attached fail failDerive1a.clj
This code triggers a type-error on line 171.





[CTYP-113] Better documentation for override-method Created: 04/Mar/14  Updated: 04/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None





[CTYP-114] Should blame correct line number if alias introduces a type error Created: 06/Mar/14  Updated: 06/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   
(def-alias Foo
  '{:a (atom Number)}) ;; this resolves to clojure.core/atom, which doesn't trigger a type error yet

(t/ann f [-> Foo])
(defn f [a]
  a)  ; we get the type error here, blaming `f`.





[CTYP-116] Apply doesn't work with dotted arguments Created: 11/Mar/14  Updated: 18/Apr/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Gary Fredericks Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File apply.diff    

 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.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 11/Mar/14 10:31 PM ]

I suspect minimal case is:

(cf (fn [f & args] (apply f args)) (All [b ...] [[b ... b -> Any] b ... b -> Any]))
Comment by Gary Fredericks [ 11/Mar/14 10:35 PM ]

Indeed I get the same error with that snippet.

Comment by Di Xu [ 18/Apr/14 9:25 PM ]

seems solved this problem





[CTYP-117] Getting deprecated warning with fn> Created: 12/Mar/14  Updated: 12/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Brian Zwahr Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Via instructions from Twitter, I'm creating this ticket. When running lein typed check against a function using fn>, I'm getting a deprecated warning message. You can see the code and message here:

https://gist.github.com/echosa/9508942






[CTYP-123] Using clojure.core.typed.async requires calling typed-deps Created: 16/Mar/14  Updated: 16/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Gary Fredericks Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

0.2.38-20140315.151412-2



 Description   

The following code will only type check if (t/typed-deps clojure.core.typed.async) is added below the ns form:

(ns controller.tmp
  (:require [clojure.core.async :as a]
            [clojure.core.typed :as t]
            [clojure.core.typed.async :as t.a]))

(t/ann my-chan [-> (t.a/Chan Number)])
(defn my-chan [] (t.a/chan> Number))

;; (t/check-ns):
;;
;; WARNING: Type Checker: Definition missing: clojure.core.async/chan
;; Hint: Use :no-check metadata with ann if this is an unchecked var
;; Checked 1 namespaces (approx. 18 lines) in 7241.543591 msecs
;; Type Error (controller/tmp.clj:18:18) Unannotated var clojure.core.async/chan
;; Hint: Add the annotation for clojure.core.async/chan via check-ns or cf
;; in: clojure.core.async/chan
;;
;;
;; Type Error (controller/tmp.clj:18:18) Cannot instantiate non-polymorphic type: Error
;; in: clojure.core.async/chan
;;
;;
;; ExceptionInfo Type Checker: Found 2 errors  
;; clojure.core/ex-info (core.clj:4403)





[CTYP-129] select-keys on HMap returns Map with union key and value types Created: 30/Mar/14  Updated: 30/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Timo Mihaljov Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

core.typed 0.2.40



 Description   

Currently select-keys on an HMap returns a Map with unions for keys and values.

=> (t/cf {:foo 1, :bar "2", :baz \3})
[(HMap :mandatory {:baz (Value \3), :bar (Value "2"), :foo (Value 1)} :complete? true) {:then tt, :else ff}]

=> (t/cf (select-keys {:foo 1, :bar "2", :baz \3}
                      [:foo :bar]))
(t/Map (U (Value :baz) (Value :foo) (Value :bar)) (U (Value 1) (Value \3) (Value "2")))

This results in type errors when select-keys is used to remove extra keys from an HMap.

Expected behaviour: select-keys should return an HMap with a subset of the :mandatory keys of its input HMap.






[CTYP-133] Typechecker fails when checking involves an object from reify Created: 13/Apr/14  Updated: 13/Apr/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Daniel Ziltener Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: bug
Environment:

Clojure 1.6.0, core.typed 0.2.44



 Description   

The error message is

No method in multimethod 'check' for dispatch value: :reify

The following is a minimal test case which fails:

core.clj
(ns core-typed-bug.core
  (:require [clojure.core.typed :refer :all]))

(ann-protocol ITypedTest
              get-data [ITypedTest -> Any])
(defprotocol> ITypedTest
  (get-data [this]))

(ann typed-test [String -> ITypedTest])
(defn typed-test [input]
  (reify ITypedTest
    (get-data [_] input)))

(defn> testfn :- Any
  [asdf :- Keyword, in :- ITypedTest]
  (get-data in))

Likely similar to bug http://dev.clojure.org/jira/browse/CTYP-132






[CTYP-8] Support complex map manipulation functions Created: 03/Mar/13  Updated: 08/Mar/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: 0.2.0

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

update-in, assoc-in, select-keys






[CTYP-9] Support metadata types Created: 03/Mar/13  Updated: 03/Mar/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Metadata kinda works, but needs more tests and special cases for `with-meta` and `meta`.






[CTYP-11] Infer good types for loop locals Created: 03/Mar/13  Updated: 03/Mar/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Loop locals need a decent type generalisation scheme. Use Typed Racket's as a model.






[CTYP-12] Handle primitives properly Created: 03/Mar/13  Updated: 03/Mar/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Currently Java primitives can travel anywhere, without consideration for boxing.






[CTYP-13] Understand common contract functions Created: 03/Mar/13  Updated: 28/Aug/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

juxt, every?, comp, partial, are very useful for type information.

The idiom (every? p? (keys m)) should cast maps.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 28/Aug/13 8:11 AM ]

Added support for every? in 0.1.25-SNAPSHOT.





[CTYP-15] Eliminate the need to specify all ancestors in alter-class. Created: 08/Mar/13  Updated: 08/Mar/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: 0.2.0

Type: Task Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None





[CTYP-16] Parameterise IFn instead of special function type. Created: 08/Mar/13  Updated: 16/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: 0.2.0

Type: Task Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Comments   
Comment by Chris Spencer [ 16/Sep/13 5:54 AM ]

Need to support primitive hinted functions too:

user=> (defn f [^long x] x)
#'user/f
user=> (clojure.tools.analyzer/analyze-form '(fn [] (f 5)))
{:op :fn-expr, :env {:line 1, :locals {}, :ns {:name user}}, :methods ({:op :fn-method, :env {:locals {}, :ns {:name user}}, :body {:op :do, :env {:source "NO_SOURCE_FILE", :column 46, :line 1, :locals {}, :ns {:name user}}, :exprs ({:op :instance-method, :env {:source "NO_SOURCE_FILE", :column 46, :line 1, :locals {}, :ns {:name user}}, :target {:op :var, :env {:locals {}, :ns {:name user}}, :var #'user/f, :tag clojure.lang.IFn$LO}, :method-name "invokePrim", :method #clojure.reflect.Method{:name invokePrim, :return-type java.lang.Object, :declaring-class clojure.lang.IFn$LO, :parameter-types [long], :exception-types [], :flags #{:public :abstract}}, :args ({:op :number, :env {:locals {}, :ns {:name user}}, :val 5}), :tag nil})}, :required-params (), :rest-param nil}), :variadic-method nil, :tag nil}




[CTYP-18] Implement equality filters Created: 10/Mar/13  Updated: 10/Mar/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Equality filters show that two local bindings are essentially equivalent (eg. aliased). This is useful where macros alias user-known locals with gensyms, like in :as map destructuring.






[CTYP-55]  clojure.lang.RT/longCast is interpreted incorrectly Created: 11/Sep/13  Updated: 11/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Chris McDevitt Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: bug


 Description   

tested version: 0.2.5

Functions that cast to long like neg? / pos? don't work with type checking. eg. (cf (pos? (dec 1)))

> (cf (long (dec 1)))

Type Error (myapp.core:1:5) Type mismatch:

Expected: 	long

Actual: 	AnyInteger
ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.clj:4327)


 Comments   
Comment by Chris McDevitt [ 11/Sep/13 12:03 PM ]

workaround is (cf (#'pos? (dec 1)))





[CTYP-58] nth can't be used on Sets, but type checks as ok Created: 14/Sep/13  Updated: 14/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Chris Spencer Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

(nth #{5} 4) checks as ok, but fails at runtime. Just need a more accurate type for nth.






[CTYP-59] Return accurate type from first for heterogenous vectors Created: 14/Sep/13  Updated: 14/Sep/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Chris Spencer Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

(first [1 'a]) currently typed as (U (Value a) (Value 1)) rather than (Value 1)






[CTYP-76] Support KwArgsSeq in apply Created: 01/Oct/13  Updated: 01/Oct/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Leonardo Borges Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Applying keyword arguments doesn't work properly at the moment.

To reproduce:

Unable to find source-code formatter for language: clojure. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
(cf (ann fn2 [(HMap :mandatory {}) & {} -> '[] ]))
(cf (defn fn2 [m & args]
      []))

(cf (ann fn1 [(HMap :mandatory {}) & {} -> Boolean ]))
(cf (defn fn1 [m & args]
      (empty? (apply fn2 (cons m args)))))

;;This is how it's used:
 (fn1 {} :a string? :b keyword? :c another-boolean-fn?)

;; And this is the type error:

;; Type Error (bouncer.core:2:28) Polymorphic function clojure.core/cons could not be applied to arguments:
;; Polymorphic Variables:
;;   x

;; Domains:
;; 	x (Option (clojure.lang.Seqable x))

;; Arguments:
;; 	(HMap :mandatory {}) (KwArgsSeq)

;; Ranges:
;; 	(clojure.lang.ASeq x)

;; in: (clojure.core/cons m args)

;; in: (clojure.core/empty? (clojure.core/apply bouncer.core/fn2 (clojure.core/cons m args)))

;;  [2 times]
;;  [2 times]
;; Type Error (bouncer.core:2:17) Bad arguments to apply: 

;; Target: 	(Fn [(HMap :mandatory {}) & {} -> []])

;; Arguments:	Error

;; in: (clojure.core/empty? (clojure.core/apply bouncer.core/fn2 (clojure.core/cons m args)))

;;  [2 times]
;;  [2 times]
;; ExceptionInfo Type Checker: Found 2 errors  clojure.core/ex-info (core.clj:4327)

;; Mark set





[CTYP-93] Support refinement types Created: 08/Nov/13  Updated: 08/Nov/13

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Typed Racket's refinement types are useful. We should implement something similar.






[CTYP-110] Add satisfies? Created: 27/Feb/14  Updated: 27/Feb/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

We should support satisfies?. Needs to be hard-coded like instance?.






[CTYP-119] Record/datatypes should update like HMaps via occurrence typing Created: 13/Mar/14  Updated: 13/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None





[CTYP-124] case should utilize negative information Created: 21/Mar/14  Updated: 23/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Sean Corfield Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Per discussion on IRC, here's the refheap of the test case: https://www.refheap.com/62684



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 23/Mar/14 1:41 PM ]

Not as simple as I thought due to `case` scoping a fresh local.

https://github.com/clojure/core.typed/commit/c13396739b3b5bc8b6349b4fdb2613bc942224a9





[CTYP-131] Support (apply f (apply concat hmap)) Created: 31/Mar/14  Updated: 31/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Started work on turning (apply concat hmap) into a KwArgsSeq https://github.com/clojure/core.typed/commit/8f38ee9c018a56beae57e1639401919f4ce8c0f2

Need to utilise this information in check-apply.






[CTYP-134] Allow namespace aliases in `ann` Created: 14/Apr/14  Updated: 14/Apr/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Oskar Thorén Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 1
Labels: None


 Description   

If I have a function which uses an external library, I want to be able to write:

(ann ^:no-check json/parse-string [String Boolean -> Map])

instead of

(ann ^:no-check cheshire.core/parse-string [String Boolean -> Map])

since that's the form I use in my namespace.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 14/Apr/14 6:43 AM ]

This might also apply to `ann-protocol`.





[CTYP-109] Better error message for TFn app Created: 27/Feb/14  Updated: 27/Feb/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Trivial
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Currently applying a no-TFn type as an operator to TApp gets this error:

"Type Error (pallet/utils.clj:378:22) First argument to TApp must be TFn, actual: Symbol" mean?
ambrosebs
it's found a type like (Symbol ...)

https://www.refheap.com/48221

Should be clearer.






[CTYP-111] Clearer error message for misusing special type Created: 27/Feb/14  Updated: 27/Feb/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Trivial
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Using HMap and Fn outside of the first argument of a paren could give a clearer hint.






[CTYP-112] Better error for type mismatch with loop/recur Created: 04/Mar/14  Updated: 04/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Trivial
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Currently a type error (especially involving locals) that complains about a mismatch to a recur statement could be more descriptive. Perhaps mention where the corresponding loop> is? Should also mention the recur statement.

(loop> [f :- AnyInteger]
(let [n (ann-form 1.2 (U Number nil))]
(recur n)))

Type Error (clojure/math/numeric_tower.clj:89:10) Local binding n530 expected type AnyInteger, but actual type (U Number nil)
in: n530






[CTYP-128] Trim down the AOT jar Created: 28/Mar/14  Updated: 28/Mar/14

Status: Open
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Trivial
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Started some work here https://github.com/clojure/core.typed/commit/d5c1d23f15301100e36f0290df43ad09e4b377d1

All tests started failing.






Generated at Thu Apr 24 18:10:12 CDT 2014 using JIRA 4.4#649-r158309.