<< Back to previous view

[CTYP-214] core.typed 0.2.84 raises an exception when trying to infer the type of (atom #{}) Created: 22/Apr/15  Updated: 22/Apr/15

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

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

Java 1.8



 Description   

Setup core.typed, for example

$ lein try org.clojure/core.typed "0.2.84"

and then simply execute

user=> (require 'clojure.core.typed)
nil
user=> (clojure.core.typed/cf (atom #{}))
Initializing core.typed ...
Building core.typed base environments ...
Finished building base environments
"Elapsed time: 4622.004619 msecs"
core.typed initialized.
IllegalArgumentException No value supplied for key: true clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)

Here's the whole stacktrace

java.lang.IllegalArgumentException: No value supplied for key: true
      PersistentHashMap.java:77 clojure.lang.PersistentHashMap.create
               type_rep.clj:614 clojure.core.typed.type-rep/-hset
                RestFn.java:423 clojure.lang.RestFn.invoke
         promote_demote.clj:221 clojure.core.typed.promote-demote/fn[fn]
         promote_demote.clj:218 clojure.core.typed.promote-demote/fn
               MultiFn.java:231 clojure.lang.MultiFn.invoke
          promote_demote.clj:49 clojure.core.typed.promote-demote/promote-var
                cs_gen.clj:1090 clojure.core.typed.cs-gen/promote-F
                cs_gen.clj:1116 clojure.core.typed.cs-gen/cs-gen-right-F
                 cs_gen.clj:328 clojure.core.typed.cs-gen/cs-gen[fn]
                 cs_gen.clj:316 clojure.core.typed.cs-gen/cs-gen
                cs_gen.clj:1594 clojure.core.typed.cs-gen/cs-gen-list[fn]
                LazySeq.java:40 clojure.lang.LazySeq.sval
                LazySeq.java:49 clojure.lang.LazySeq.seq
                    RT.java:484 clojure.lang.RT.seq
                   core.clj:133 clojure.core/seq
                  core.clj:2855 clojure.core/dorun
                  core.clj:2871 clojure.core/doall
                cs_gen.clj:1592 clojure.core.typed.cs-gen/cs-gen-list
                RestFn.java:587 clojure.lang.RestFn.invoke
                cs_gen.clj:1747 clojure.core.typed.cs-gen/infer
                 funapp.clj:277 clojure.core.typed.check.funapp/check-funapp[fn]
                 funapp.clj:202 clojure.core.typed.check.funapp/check-funapp[fn]
                 funapp.clj:192 clojure.core.typed.check.funapp/check-funapp[fn]
                  funapp.clj:52 clojure.core.typed.check.funapp/check-funapp
                  invoke.clj:13 clojure.core.typed.check.invoke/normal-invoke
                RestFn.java:587 clojure.lang.RestFn.invoke
                 check.clj:1294 clojure.core.typed.check/check -COLON-invoke17233[fn]
                 check.clj:1273 clojure.core.typed.check/check -COLON-invoke17233
                RestFn.java:423 clojure.lang.RestFn.invoke
               MultiFn.java:231 clojure.lang.MultiFn.invoke
                  check.clj:151 clojure.core.typed.check/check-expr
                RestFn.java:423 clojure.lang.RestFn.invoke
       check_form_common.clj:40 clojure.core.typed.check-form-common/check-form-info[fn]
       check_form_common.clj:37 clojure.core.typed.check-form-common/check-form-info[fn]
                   AFn.java:152 clojure.lang.AFn.applyToHelper
                   AFn.java:144 clojure.lang.AFn.applyTo
                   core.clj:624 clojure.core/apply
                  core.clj:1862 clojure.core/with-bindings*
                RestFn.java:425 clojure.lang.RestFn.invoke
       check_form_common.clj:25 clojure.core.typed.check-form-common/check-form-info
                RestFn.java:521 clojure.lang.RestFn.invoke
       check_form_common.clj:61 clojure.core.typed.check-form-common/check-form*
          check_form_clj.clj:22 clojure.core.typed.check-form-clj/check-form*
                 typed.clj:2155 clojure.core.typed/check-form*
                 typed.clj:2151 clojure.core.typed/check-form*
               NO_SOURCE_FILE:1 user/eval13925
             Compiler.java:6703 clojure.lang.Compiler.eval
             Compiler.java:6666 clojure.lang.Compiler.eval
                  core.clj:2927 clojure.core/eval
                   main.clj:239 clojure.main/repl[fn]
                   main.clj:239 clojure.main/repl[fn]
                   main.clj:257 clojure.main/repl[fn]
                   main.clj:257 clojure.main/repl
               RestFn.java:1523 clojure.lang.RestFn.invoke
      interruptible_eval.clj:67 clojure.tools.nrepl.middleware.interruptible-eval/evaluate[fn]
                   AFn.java:152 clojure.lang.AFn.applyToHelper
                   AFn.java:144 clojure.lang.AFn.applyTo
                   core.clj:624 clojure.core/apply
                  core.clj:1862 clojure.core/with-bindings*
                RestFn.java:425 clojure.lang.RestFn.invoke
      interruptible_eval.clj:51 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
     interruptible_eval.clj:183 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval[fn]
     interruptible_eval.clj:152 clojure.tools.nrepl.middleware.interruptible-eval/run-next[fn]
                    AFn.java:22 clojure.lang.AFn.run
   ThreadPoolExecutor.java:1142 java.util.concurrent.ThreadPoolExecutor.runWorker
    ThreadPoolExecutor.java:617 java.util.concurrent.ThreadPoolExecutor$Worker.run
                Thread.java:745 java.lang.Thread.run

note that `(cf #{})`, or `(cf (atom {}))` or other variants all work. It only seems to be a problem with `(atom #{})`.






[CTYP-213] core.typed 0.2.87 fails in combination with org.clojure/tools.analyzer.jvm 0.6.5 on Clojure 1.6 Created: 21/Apr/15  Updated: 21/Apr/15

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

Type: Defect Priority: Major
Reporter: Jakub Arnold Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 1
Labels: None
Environment:

Clojure 1.6.0, Java 8, OS X 10.10.3



 Description   

To reproduce, simply run

$ lein try org.clojure/core.typed "0.2.87" org.clojure/tools.analyzer.jvm "0.6.5" org.clojure/clojure "1.6.0"

and then basically any attempt to use core.typed will fail with the same error, for example

user=> (require '[clojure.core.typed :as t])
nil
user=> (t/cf 1)
Initializing core.typed ...
Building core.typed base environments ...
Finished building base environments
"Elapsed time: 16052.550743 msecs"
core.typed initialized.

UnsupportedOperationException nth not supported on this type: Long clojure.lang.RT.nthFrom (RT.java:857)

note that there are similar combinations of versions that do work, such as

$ lein try org.clojure/core.typed "0.2.84" org.clojure/tools.analyzer.jvm "0.6.5" org.clojure/clojure "1.6.0"



 Comments   
Comment by Jakub Arnold [ 21/Apr/15 7:04 PM ]

Here are a few more detailed logs of different scenarios

broken `lein try org.clojure/core.typed "0.2.87" org.clojure/tools.analyzer.jvm "0.6.5" org.clojure/clojure "1.6.0"`
https://gist.github.com/darthdeus/5f3a40cdff8e21eed15d

working `lein try org.clojure/core.typed "0.2.84" org.clojure/tools.analyzer.jvm "0.6.6"` https://gist.github.com/darthdeus/6a3a7f5fb91073575f77

possibly related issue on `lein try org.clojure/core.typed "0.2.87" org.clojure/tools.analyzer.jvm "0.6.6"`
https://gist.github.com/darthdeus/88b5b8f94fafdb85d81f

and the original issue with a full stacktrace https://gist.github.com/darthdeus/1a071c829e2aa4b96a09





[CTYP-212] Can't create a promise of the same type as a record field Created: 20/Apr/15  Updated: 22/Apr/15

Status: Reopened
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:

[org.clojure/core.typed "0.2.84"]
[org.clojure/clojure "1.6.0"]



 Description   

It seems to be impossible to create a promise of the same type as a record field:

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

(t/ann-record MyRecord [p :- (t/Promise int)])

(defrecord MyRecord [p])

(defn foo []
  (t/let [x :- (t/Promise int) (promise)]))

; Type Error (cttest/core.clj:9:32) Polymorphic function promise could not be applied to arguments:
; Polymorphic Variables:
;         x
;
; Domains:
;
;
; Arguments:
;
;
; Ranges:
;         (t/Promise x)
;
; with expected type:
;         (t/Promise int)
;
; in: (promise)
; in: (promise)

Changing the type of p in MyRecord to any other type, say (t/Promise String) makes foo pass the type checker.



 Comments   
Comment by Timo Mihaljov [ 20/Apr/15 11:36 PM ]

I hit the save button too soon. I couldn't reproduce this in a clean project, so there's something else going on in my project that's causing this. I might reopen the issue once I've narrowed down what's causing it.

Comment by Timo Mihaljov [ 22/Apr/15 12:39 AM ]

The difference was that the test project was missing the record. I've reopened the issue now that it's reproducible.





[CTYP-210] (long AnyInteger) doesn't typecheck Created: 08/Apr/15  Updated: 14/Apr/15

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:

[org.clojure/core.typed "0.2.84"]
[org.clojure/clojure "1.6.0"]



 Description   
reiska.core=> (t/cf (long (+ 2 (int 123))))
Type Error (/private/var/folders/x2/47j5hlbs01b9b4mjz_8fyf05m8hy4p/T/form-init7340610759194794514.clj:1:7) Static method clojure.lang.RT/longCast could not be applied to arguments:


Domains:
        long

Arguments:
        t/AnyInteger

Ranges:
        long

in: (clojure.lang.RT/longCast (clojure.lang.Numbers/add 2 (clojure.lang.RT/intCast 123)))
in: (clojure.lang.RT/longCast (clojure.lang.Numbers/add 2 (clojure.lang.RT/intCast 123)))


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


 Comments   
Comment by Timo Mihaljov [ 14/Apr/15 10:57 PM ]

Here's what I think is going on:

1. clojure.core/long is defined as an inlineable function, so its body gets inlined and core.typed never sees the function application (long x) (where long's type is [t/Any -> Long]). Instead, it sees the method application (clojure.lang.RT/longCast x) and has to infer the method's type from its Java type.

This hypothesis is supported by the following experiment. Commenting out the inline form in a copy of clojure.core/long makes it apply cleanly to t/AnyInteger values.

;;; Doesn't typecheck

(t/ann ^:no-check my-long [t/Any -> long])
(defn my-long
  {:inline (fn [x] `(. clojure.lang.RT (longCast ~x)))}
  [^Number x]
  (clojure.lang.RT/longCast x))

(def a (my-long (t/ann-form 123 t/AnyInteger)))
;;; Typechecks

(t/ann ^:no-check my-long2 [t/Any -> long])
(defn my-long2
  ; Commented out: {:inline (fn [x] `(. clojure.lang.RT (longCast ~x)))}
  [^Number x]
  (clojure.lang.RT/longCast x))

(def b (my-long2 (t/ann-form 123 t/AnyInteger)))

2. The clojure.lang.RT/longCast method is overloaded. It seems that instead of inferring a multi-arity type, core.typed seems to pick just one of the arities. In this case it picks the wrong arity: t/AnyInteger is a valid argument to longCast(Object x), but not the picked longCast(long x).





[CTYP-209] method-type is broken Created: 08/Apr/15  Updated: 08/Apr/15

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:

[org.clojure/core.typed "0.2.84"]
[org.clojure/clojure "1.6.0"]



 Description   
reiska.core=> (t/method-type 'java.lang.Runtime/availableProcessors)

AssertionError Assert failed: Cannot find var: clojure.core.typed.check/Method->Type
(var? var)  clojure.core.typed.current-impl/v (current_impl.clj:19)





[CTYP-204] Assoc doesn't work with multiple entries Created: 10/Mar/15  Updated: 10/Mar/15

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

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


 Description   

(from https://groups.google.com/d/msg/clojure-core-typed/4z_7WnqZsyI/53jlUHQfWhEJ)

The following code:

(t/ann new-ar (t/All [[m :< (t/Map t/Any t/Any)]] [m -> (t/Assoc m ':id Number ':version Number)]))
(defn new-ar
[detail]
{:post [(not (nil? (:id %)))
(zero? (:version %))]}
(assoc detail :id 10 :version 0))

gives the following error:

Type Error (qfi/health/core/domain/model/common.clj:40:3) Cannot assoc args `[(clojure.core.typed/Val :id) {:then tt, :else ff}] [(clojure.core.typed/Val 10) {:then tt, :else ff}] [(clojure.core.typed/Val :version) {:then tt, :else ff}] [(clojure.core.typed/Val 0) {:then tt, :else ff}]` on m
in: (assoc detail :id 10 :version 0)






[CTYP-203] Internal error Created: 09/Mar/15  Updated: 09/Mar/15

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

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

osx yosemite, jdk 7



 Description   

The following REPL shows the problem:

(t/defalias BaseValidationSchema
'[java.lang.Boolean (t/HMap :complete? false)])

=> nil
(t/cf [true {}] BaseValidationSchema)
Type Error (NO_SOURCE_FILE) Internal Error (:<NO LINE>) Wrong number of arguments passed to type function. Expected 1, actual 2: clojure.core.typed/Vec [java.lang.Boolean (clojure.core.typed/HMap :mandatory {})]
ExceptionInfo Type Checker: Found 1 error clojure.core/ex-info (core.clj:4403)
(t/cf [true {}] '[java.lang.Boolean (t/HMap :complete? false)])
=> [(t/HVec [true (t/HMap :complete? true)]) {:then tt, :else ff}]

From https://groups.google.com/d/msg/clojure-core-typed/uX2v9wbwTwI/yyErih2cPDMJ






[CTYP-202] Provide a way to annotate a throw-on-nil function Created: 27/Feb/15  Updated: 27/Feb/15

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

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


 Description   

This functions seems impossible to annotate at the moment because the input and output should be the same only if the input is not nil.
We need a way to describe the output type as: The input type without nil
This is useful if the input type is for example (U String nil) and we want to hand the validation off to our throw-on-nil function.

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

(t/ann throw-on-nil (t/All [x] (t/IFn [x -> x])))
(defn throw-on-nil
  ([value] (if (nil? value)
             (throw (Exception. "Value is nil"))
             value)))

(t/ann -main [(t/U nil String) * -> t/Any])
(defn -main [& args]
  (t/let [input (first args)
          in :- String (throw-on-nil input)]
    (println in)))

Error:

Type Error (example/core.clj:13:26) Polymorphic function throw-on-nil could not be applied to arguments:
Polymorphic Variables:
        x

Domains:
        x

Arguments:
        (t/U nil String)

Ranges:
        x

with expected type:
        java.lang.String

in: (throw-on-nil input)
in: (throw-on-nil input)


Type Checker: Found 1 error





[CTYP-201] Calling a multimethod from a protocol function breaks the type checker Created: 27/Feb/15  Updated: 27/Feb/15

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

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


 Description   

When i call a multimethod from within a protocol implementation, i receive a long error.

Minimum working example including error output:
https://github.com/exi/core-typed-errors

Code:

(ns example.core
  (:import java.io.File)
  (:require [clojure.core.typed :as t]))

(declare dispatcher)

(t/ann-protocol MProto
                myfn (t/IFn [MProto File -> String]))
(defprotocol MProto
  (myfn [this obj]))

(t/ann-record MRec [name :- String])
(defrecord MRec [name]
  MProto
  (myfn [this obj] (dispatcher this obj)))

(t/ann dispatcher (t/IFn [MRec File -> String]))
(defmulti dispatcher (fn [rec obj] (class obj)))

(defmethod dispatcher
  File
  [rec obj]
  (:name rec))

(defn -main [& args]
  (let [rec (MRec. "myname")
        file (File. ".")]
    (when (not (nil? file))
      (println (myfn rec file)))))

Error message:

Initializing core.typed ...
Building core.typed base environments ...
Finished building base environments
"Elapsed time: 3564.305528 msecs"
core.typed initialized.
Start collecting example.core
Finished collecting example.core
Collected 1 namespaces in 681.706266 msecs
Not checking clojure.core.typed (does not depend on clojure.core.typed)
Start checking example.core
nil Not checking example.core/MProto definition
13:  Not checking example.core/->MRec definition
Checked example.core in 1019.900549 msecs
WARNING: Type Checker: Definition missing: clojure.core/assert-same-protocol 
Hint: Use :no-check metadata with ann if this is an unchecked var
WARNING: Type Checker: Definition missing: clojure.core/-cache-protocol-fn 
Hint: Use :no-check metadata with ann if this is an unchecked var
WARNING: Type Checker: Definition missing: clojure.core/-reset-methods 
Hint: Use :no-check metadata with ann if this is an unchecked var
Checked 2 namespaces  in 1717.619162 msecs
Type Error (example/core.clj:9:1) Polymorphic function clojure.core/alter-meta! could not be applied to arguments:
Polymorphic Variables:
	b

Domains:
	clojure.lang.IReference [(t/U nil (IPersistentMap t/Any t/Any)) b ... b -> (t/U nil (IPersistentMap t/Any t/Any))] b ... b

Arguments:
	(Var t/Any t/Any) (t/All [b c d] (t/IFn [(t/Map b c) b c -> (t/Map b c)] [(t/Vec d) t/AnyInteger d -> (t/Vec d)])) (t/Val :doc) nil

Ranges:
	(t/U nil (IPersistentMap t/Any t/Any))

in: (clojure.core/alter-meta! (var example.core/MProto) clojure.core/assoc :doc nil)
in: (clojure.core/alter-meta! (var example.core/MProto) clojure.core/assoc :doc nil)


Type Error (example/core.clj:9:1) Untyped var reference: clojure.core/assert-same-protocol
Hint: Add the annotation for clojure.core/assert-same-protocol via check-ns or cf
in: (var clojure.core/assert-same-protocol)


Type Error (example/core.clj) Cannot call instance method example.core.MProto/myfn on type clojure.core.typed/Any
in: (.myfn gf__this__763 gf__obj__764)


Type Error (example/core.clj) Instance method example.core.MProto/myfn could not be applied to arguments:


Domains:
	Object

Arguments:
	t/Any

Ranges:
	(t/U nil Object)

in: (.myfn gf__this__763 gf__obj__764)
in: (.myfn gf__this__763 gf__obj__764)


Type Error (example/core.clj) Instance field __methodImplCache expected clojure.lang.AFunction, actual [clojure.core.typed/Any clojure.core.typed/Any -> clojure.core.typed/Any]
in: (.-__methodImplCache G__753)


Type Error (example/core.clj) Static method clojure.lang.Util/classOf could not be applied to arguments:


Domains:
	Object

Arguments:
	t/Any

Ranges:
	(t/U nil Class)

in: (clojure.lang.Util/classOf gf__this__766)
in: (clojure.lang.Util/classOf gf__this__766)


Type Error (example/core.clj) Cannot call instance method clojure.lang.MethodImplCache/fnFor on type (clojure.core.typed/U nil clojure.lang.MethodImplCache)
in: (.fnFor cache__5915__auto__ (clojure.lang.Util/classOf gf__this__766))


Type Error (example/core.clj) Cannot invoke type: IFn
in: (f__5916__auto__ gf__this__766 gf__obj__767)


Type Error (example/core.clj) Unannotated var clojure.core/-cache-protocol-fn
Hint: Add the annotation for clojure.core/-cache-protocol-fn via check-ns or cf
in: clojure.core/-cache-protocol-fn


Type Error (example/core.clj) Instance field __methodImplCache expected clojure.lang.AFunction, actual [clojure.core.typed/Any clojure.core.typed/Any -> Error]
in: (.-__methodImplCache f__5918__auto__)


Type Error (example/core.clj) Type mismatch:

Expected: 	(t/U nil MethodImplCache)

Actual: 	t/Any
in: cache__5917__auto__


Type Error (example/core.clj:9:1) Polymorphic function clojure.core/alter-var-root could not be applied to arguments:
Polymorphic Variables:
	w
	r
	b

Domains:
	(t/Var2 w r) [r b ... b -> w] b ... b

Arguments:
	(Var t/Any t/Any) (t/All [k v] (t/IFn [nil * -> nil] [(clojure.lang.IPersistentMap k v) (clojure.lang.IPersistentMap k v) * -> (clojure.lang.IPersistentMap k v)] [(t/Option (clojure.lang.IPersistentMap k v)) * -> (t/Option (clojure.lang.IPersistentMap k v))])) (t/HMap :mandatory {:method-builders (APersistentMap (t/Var2 t/Nothing t/Any) [t/Any -> [t/Any t/Any -> Error] :filters {:then tt, :else ff}]), :method-map (t/HMap :mandatory {:myfn (t/Val :myfn)} :complete? true), :var (Var t/Any t/Any), :sigs (t/HMap :mandatory {:myfn (t/HMap :mandatory {:file (t/Val "example/core.clj"), :line (t/Val 10), :column (t/Val 4), :end-line (t/Val 10), :end-column (t/Val 9), :name (t/Val myfn), :arglists (ISeq (t/HVec [(t/Val this) (t/Val obj)])), :doc nil} :complete? true)} :complete? true), :on (t/Val example.core.MProto), :on-interface (t/Val example.core.MProto)} :complete? true)

Ranges:
	w

in: (clojure.core/alter-var-root (var example.core/MProto) clojure.core/merge (clojure.core/assoc {:on (quote example.core.MProto), :on-interface example.core.MProto} :sigs (quote {:myfn {:doc nil, :arglists ([this obj]), :name myfn, :end-column 9, :end-line 10, :column 4, :line 10, :file "example/core.clj"}}) :var (var example.core/MProto) :method-map {:myfn :myfn} :method-builders {(clojure.core/intern clojure.core/*ns* (clojure.core/with-meta (quote myfn) (clojure.core/merge (quote {:doc nil, :arglists ([this obj]), :name myfn, :end-column 9, :end-line 10, :column 4, :line 10, :file "example/core.clj"}) {:protocol (var example.core/MProto)}))) (fn* ([cache__5917__auto__] (let* [G__754 (fn* ([gf__this__763 gf__obj__764] (.myfn gf__this__763 gf__obj__764))) f__5918__auto__ (fn* G__753 ([gf__this__766 gf__obj__767] (let* [cache__5915__auto__ (.-__methodImplCache G__753) f__5916__auto__ (.fnFor cache__5915__auto__ (clojure.lang.Util/classOf gf__this__766))] (if f__5916__auto__ (f__5916__auto__ gf__this__766 gf__obj__767) ((clojure.core/-cache-protocol-fn G__753 gf__this__766 example.core.MProto G__754) gf__this__766 gf__obj__767)))))] (do (set! (.-__methodImplCache f__5918__auto__) cache__5917__auto__) f__5918__auto__))))}))
in: (clojure.core/alter-var-root (var example.core/MProto) clojure.core/merge (clojure.core/assoc {:on (quote example.core.MProto), :on-interface example.core.MProto} :sigs (quote {:myfn #}) :var (var example.core/MProto) ...))


Type Error (example/core.clj) Unannotated var clojure.core/-reset-methods
Hint: Add the annotation for clojure.core/-reset-methods via check-ns or cf
in: clojure.core/-reset-methods


Type Checker: Found 13 errors
Found errors
Subprocess failed





[CTYP-200] min and max function are inferred to return java.long.Number if all parameters are Integer Created: 24/Feb/15  Updated: 02/Mar/15

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

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


 Description   

If all arguments to min/max are the same type, it should be inferred to return that type.

user.core=> (t/cf (t/fn [a :- Integer b :- Integer] (min a b)))
[[java.lang.Integer java.lang.Integer -> java.lang.Number] {:then tt, :else ff}]
user.core=> (t/cf (t/fn [a :- Integer b :- Integer] (max a b)))
[[java.lang.Integer java.lang.Integer -> java.lang.Number] {:then tt, :else ff}]

This leads to issues when I try to pass the return value of min/max as an argument of a function that expects Integer types.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 01/Mar/15 7:33 PM ]

What should this return?

Comment by Reno Reckling [ 02/Mar/15 2:24 AM ]

The min/max of two or more integers should be Integer and not Number.

Comment by Reno Reckling [ 02/Mar/15 2:33 AM ]

Example code:

=> (t/cf (t/let [mfn :- (t/IFn [Integer Integer -> Integer]) (fn [x y] (min x y))] (mfn 4 5)))
Initializing core.typed ...
Building core.typed base environments ...
Finished building base environments
"Elapsed time: 3174.574343 msecs"
core.typed initialized.
Type Error (init.clj:1:69) Type mismatch:

Expected:       java.lang.Integer

Actual:         java.lang.Number
in: (clojure.lang.Numbers/min x y)
Comment by Reno Reckling [ 02/Mar/15 3:57 AM ]

The expected type in general would be the union type of all arguments but i don't think there is a syntax for this yet:

(min Long Float BigDecimal) should have the return type (U Long Float BigDecimal) with the constraint that all types are subtypes of Number





[CTYP-198] incorrect optional keyword lookup in complete HMaps Created: 12/Feb/15  Updated: 12/Feb/15

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

Type: Defect Priority: Major
Reporter: Nathan Sorenson Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: bug, patch
Environment:

Clojure 1.6.0 on OSX 10.10


Attachments: Text File 0001-tests-for-keyword-lookup-in-HMaps-with-optional-keys.patch     Text File 0002-fix-incorrect-optional-keyword-lookup-in-complete-HM.patch    
Patch: Code and Test

 Description   

The snippet

(t/cf (:name (t/ann-form {:name "hi"} (t/HMap :optional {:name String} :complete? true))))

returns nil when it probably should return (t/U String nil)






[CTYP-197] No matching arities when defining multiple arity protocol method Created: 25/Jan/15  Updated: 25/Jan/15

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

Type: Defect Priority: Major
Reporter: Joshua Griffith Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: bug, defprotocol, deftype
Environment:

Clojure 1.6.0 and 1.7.0-alpha5


Attachments: File arity.clj     Text File typecheck.log    

 Description   

When defining multiple-arity protocol methods with clojure.core.typed/defprotocol, deftypes implementing these methods fail to typecheck with "No matching arities" errors. See attached test case.






[CTYP-195] Support for clojure.core/extend is broken when used with typed.core/defprotocol Created: 15/Jan/15  Updated: 15/Jan/15

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: None
Environment:

core.typed 0.2.77



 Description   

Using extend with a protocol defined using typed.core/defprotocol, the following error occurs:

Type Error (client/clojurefx.clj:31:1) Internal Error (client/clojurefx.clj:31:1) Expecting Protocol type, found clojure.core.typed.type_rep.TypeFn@38c0769f






[CTYP-194] HMap merged type Created: 14/Jan/15  Updated: 14/Jan/15

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

Type: Enhancement Priority: Major
Reporter: Bryan Hoyle Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: enhancement, hmap, merge
Environment:

All



 Description   

It would be nice to be able to merge several HMaps in order to simulate a parent-child relationship.
For example

(defalias Parent (t/HMap :mandatory {:type t/Keyword}))
(defalias Child1 (t/HMap :mandatory {:type (t/Value :child1)
                                     :value t/Int})

(defalias Child2 (t/HMap :mandatory {:type (t/Value :child2)
                                     :size t/Int})

(ann is-child1?
    Parent -> t/Bool])
(defn is-child1? [child]
    (= (:type child) :child1))

And have that typecheck appropriately.
As of right now, one would have to do something like

(defalias Parent (t/U Child1 Child2))

which means you have to keep track of the definition in two places to make it work as expected.






[CTYP-192] Use memoization in file-mapping to improve performance. Created: 10/Jan/15  Updated: 10/Jan/15

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

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

Attachments: Text File memoize.patch    
Patch: Code

 Description   

Use of the `:file-mapping` to `check-ns-info` now increases run time by a good factor of 5. By memoizing the conversion of types into strings, we can reduce this to a factor of 2. This will also reduce memory consumption, as multiple entries for the same symbol will now contain references to the same string, rather than copies.






[CTYP-191] Bad type syntax when parsing types of macro-generated anonymous functions from required namespaces (when the types are composed, for instance (Option AnyInteger)) Created: 09/Jan/15  Updated: 09/Jan/15

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

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


 Description   

(defmacro lol2 []
(let [a (list `typed/Option `typed/AnyInteger)]
`(fn [] :- ~a 1)))

(defmacro lol []
`(fn [] :- (typed/Option typed/AnyInteger) 1))

(clojure.core.typed/def lol*2 :- [-> (typed/Option typed/AnyInteger)]
(lol2))

(clojure.core.typed/def lol* :- (typed/Option typed/AnyInteger)
(lol))

i put this code in namespace A
both typecheck without problem

when i require namespace A from namespace B and typecheck namespace B
lol*2 is completely fine but lol* crashes with " Bad type syntax: (clojure.core.typed/Option clojure.core.typed/AnyInteger)"

(defmacro lol**3 []
`(fn [] :- typed/AnyInteger 1))

(clojure.core.typed/def lol*3 :- typed/AnyInteger
(lol**3))

works fine.






[CTYP-188] ann-record fails for argument-less records Created: 05/Jan/15  Updated: 27/Feb/15

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.7.0-alpha4, core.typed 0.2.76



 Description   

ann-record fails for records without arguments. The whole error is as follows:

1. Unhandled java.lang.AssertionError
   Assert failed: (every? r/Type? types)

                type_ctors.clj:  497  clojure.core.typed.type-ctors/In
                   RestFn.java:  137  clojure.lang.RestFn/applyTo
                      core.clj:  626  clojure.core/apply
               assoc_utils.clj:   34  clojure.core.typed.assoc-utils/fn
               assoc_utils.clj:   23  clojure.core.typed.assoc-utils/fn/G
                type_ctors.clj: 2181  clojure.core.typed.type-ctors/reduce-type-transform/fn/iter/fn
                  LazySeq.java:   40  clojure.lang.LazySeq/sval
                  LazySeq.java:   49  clojure.lang.LazySeq/seq
                       RT.java:  485  clojure.lang.RT/seq
                      core.clj:  135  clojure.core/seq
                      core.clj: 2539  clojure.core/every?
                type_ctors.clj: 2179  clojure.core.typed.type-ctors/reduce-type-transform/fn
                 protocols.clj:  148  clojure.core.protocols/fn
                 protocols.clj:   19  clojure.core.protocols/fn/G
                 protocols.clj:   31  clojure.core.protocols/seq-reduce
                 protocols.clj:   53  clojure.core.protocols/fn
                 protocols.clj:   13  clojure.core.protocols/fn/G
                      core.clj: 6461  clojure.core/reduce
                type_ctors.clj: 2184  clojure.core.typed.type-ctors/reduce-type-transform
                   RestFn.java:  494  clojure.lang.RestFn/invoke
               assoc_utils.clj:  127  clojure.core.typed.assoc-utils/assoc-type-pairs
                   RestFn.java:  139  clojure.lang.RestFn/applyTo
                      core.clj:  628  clojure.core/apply
               assoc_utils.clj:  367  clojure.core.typed.assoc-utils/merge-pair/iter/fn/fn
               assoc_utils.clj:  342  clojure.core.typed.assoc-utils/merge-pair/iter/fn
                  LazySeq.java:   40  clojure.lang.LazySeq/sval
                  LazySeq.java:   49  clojure.lang.LazySeq/seq
                       RT.java:  485  clojure.lang.RT/seq
                      core.clj:  135  clojure.core/seq
                      core.clj: 2559  clojure.core/some
                type_ctors.clj: 2161  clojure.core.typed.type-ctors/union-or-nil
               assoc_utils.clj:  342  clojure.core.typed.assoc-utils/merge-pair
                type_ctors.clj: 2181  clojure.core.typed.type-ctors/reduce-type-transform/fn/iter/fn
                  LazySeq.java:   40  clojure.lang.LazySeq/sval
                  LazySeq.java:   49  clojure.lang.LazySeq/seq
                       RT.java:  485  clojure.lang.RT/seq
                      core.clj:  135  clojure.core/seq
                      core.clj: 2559  clojure.core/some
                type_ctors.clj: 2161  clojure.core.typed.type-ctors/union-or-nil
                type_ctors.clj: 2184  clojure.core.typed.type-ctors/reduce-type-transform
                   RestFn.java:  445  clojure.lang.RestFn/invoke
               assoc_utils.clj:  375  clojure.core.typed.assoc-utils/merge-types
                   RestFn.java:  139  clojure.lang.RestFn/applyTo
                      core.clj:  628  clojure.core/apply
                     check.clj: 1072  clojure.core.typed.check/merge)17420
                   RestFn.java:  423  clojure.lang.RestFn/invoke
                  MultiFn.java:  233  clojure.lang.MultiFn/invoke
                     check.clj: 1245  clojure.core.typed.check/check :invoke17476/fn
                     check.clj: 1243  clojure.core.typed.check/check :invoke17476


 Comments   
Comment by Daniel Ziltener [ 05/Jan/15 10:59 PM ]

Ok, mistake, this actually happens in certain assoc situations.

Comment by Reno Reckling [ 27/Feb/15 8:25 PM ]

Could you please post a minimum working example or some code to trigger this bug?





[CTYP-177] Compile error with core.async Created: 02/Dec/14  Updated: 02/Dec/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:

[org.clojure/clojure "1.6.0"]
[org.clojure/core.typed "0.2.72"]
[org.clojure/core.async "0.1.267.0-0d7780-alpha"]



 Description   

The following namespace gives me a compile-time error:

(ns typed-async-whatsit.core
  (:require [clojure.core.async :as a]
            [clojure.core.typed :as t]
            [clojure.core.typed.async :as t.a]))

(t/ann connect [-> nil])
(defn connect
  []
  (let [ch (t.a/chan :- String)]
    (t.a/go-loop []
      (a/>! ch "hey hey"))
    nil))

The error is:

Exception in thread "main" java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.util.Map$Entry, compiling:(typed_async_whatsit/core.clj:22:5)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6651)
    at clojure.lang.Compiler.analyze(Compiler.java:6445)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6632)
    at clojure.lang.Compiler.analyze(Compiler.java:6445)
    at clojure.lang.Compiler.analyze(Compiler.java:6406)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5782)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6100)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6644)
    at clojure.lang.Compiler.analyze(Compiler.java:6445)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6632)
    at clojure.lang.Compiler.analyze(Compiler.java:6445)
    at clojure.lang.Compiler.analyze(Compiler.java:6406)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5782)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5217)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3846)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6642)
    at clojure.lang.Compiler.analyze(Compiler.java:6445)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6632)
    at clojure.lang.Compiler.analyze(Compiler.java:6445)
    at clojure.lang.Compiler.access$100(Compiler.java:38)
    at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:538)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6644)
    at clojure.lang.Compiler.analyze(Compiler.java:6445)
    at clojure.lang.Compiler.analyze(Compiler.java:6406)
    at clojure.lang.Compiler.eval(Compiler.java:6707)
    at clojure.lang.Compiler.load(Compiler.java:7130)
    at clojure.lang.RT.loadResourceScript(RT.java:370)
    at clojure.lang.RT.loadResourceScript(RT.java:361)
    at clojure.lang.RT.load(RT.java:440)
    at clojure.lang.RT.load(RT.java:411)
    at clojure.core$load$fn__5066.invoke(core.clj:5641)
    at clojure.core$load.doInvoke(core.clj:5640)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5446)
    at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
    at clojure.core$load_lib.doInvoke(core.clj:5485)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$load_libs.doInvoke(core.clj:5524)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$require.doInvoke(core.clj:5607)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at user$eval1884.invoke(form-init6964782882533247650.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6703)
    at clojure.lang.Compiler.eval(Compiler.java:6666)
    at clojure.core$eval.invoke(core.clj:2927)
    at clojure.main$eval_opt.invoke(main.clj:288)
    at clojure.main$initialize.invoke(main.clj:307)
    at clojure.main$null_opt.invoke(main.clj:342)
    at clojure.main$main.doInvoke(main.clj:420)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
    at user$eval1870.invoke(form-init6964782882533247650.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6703)
    at clojure.lang.Compiler.eval(Compiler.java:6693)
    at clojure.lang.Compiler.load(Compiler.java:7130)
    at clojure.lang.Compiler.loadFile(Compiler.java:7086)
    at clojure.main$load_script.invoke(main.clj:274)
    at clojure.main$init_opt.invoke(main.clj:279)
    at clojure.main$initialize.invoke(main.clj:307)
    at clojure.main$null_opt.invoke(main.clj:342)
    at clojure.main$main.doInvoke(main.clj:420)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.util.Map$Entry
    at clojure.lang.APersistentMap$KeySeq.first(APersistentMap.java:154)
    at clojure.lang.RT.first(RT.java:577)
    at clojure.core$first.invoke(core.clj:55)
    at clojure.core$zipmap.invoke(core.clj:2790)
    at clojure.core.async.impl.ioc_macros$parse_to_state_machine$fn__3229.invoke(ioc_macros.clj:806)
    at clojure.core.async.impl.ioc_macros$get_plan.invoke(ioc_macros.clj:77)
    at clojure.core.async.impl.ioc_macros$parse_to_state_machine.invoke(ioc_macros.clj:805)
    at clojure.core.async.impl.ioc_macros$state_machine.invoke(ioc_macros.clj:990)
    at clojure.core.typed.async$go.doInvoke(async.clj:328)
    at clojure.lang.RestFn.invoke(RestFn.java:442)
    at clojure.lang.Var.invoke(Var.java:388)
    at clojure.lang.AFn.applyToHelper(AFn.java:160)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.lang.Compiler.macroexpand1(Compiler.java:6552)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6630)
    ... 82 more





[CTYP-176] No such var: ana/ns->relpath when loading the ClojureScript typechecker Created: 08/Oct/14  Updated: 08/Apr/15

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

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


 Description   

Looks like ns->relpath moved from cljs.analyzer to cljs.util: https://github.com/clojure/clojurescript/commit/88873ed1053810d869febe28e58a45fa24769437#diff-d7b925f0cdb496ec057f02327d4e1b0dR6



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 08/Oct/14 11:43 PM ]

Thanks, I'll keep this in mind when I upgrade the ClojureScript dep.

Comment by Vic Goldfeld [ 08/Apr/15 1:00 PM ]

I'm getting this error now with all the latest ClojureScript and core.typed.





[CTYP-174] More fixes for closed source projects (datomic) Created: 15/Sep/14  Updated: 05/Mar/15

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

Type: Defect Priority: Major
Reporter: Allen Rohner Assignee: Allen Rohner
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File 0001-More-fixes-for-nses-with-no-source.patch     File ctyp-174-2.diff    

 Description   

CTYP-166 was incomplete. The attached patch gets farther through checking. I haven't gotten an :ok yet w/ my datomic project, so I don't know if this is complete either

The main change is that the line about "checked N lines" now returns 0 for namespaces where we can't find the source.



 Comments   
Comment by Allen Rohner [ 03/Feb/15 4:05 PM ]

I've successfully gotten ':ok' using this patch. Can it get included?

Comment by Ambrose Bonnaire-Sergeant [ 07/Feb/15 2:47 PM ]

Patch doesn't seem to apply

[abonnair@catbert datomic]$ git am --keep-cr -s --ignore-whitespace < 0001-More-fixes-for-nses-with-no-source.patch 
Applying: More fixes for nses with no source
error: patch failed: module-check/src/main/clojure/clojure/core/typed/check_ns_common.clj:89
error: module-check/src/main/clojure/clojure/core/typed/check_ns_common.clj: patch does not apply
Patch failed at 0001 More fixes for nses with no source
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Comment by Allen Rohner [ 05/Mar/15 12:59 PM ]

It looks like the first didn't apply because the code has drifted. Uploaded a second attempt, ctyp-174-2.diff. It should apply cleanly to master, on its own. The change is very simple, it just returns an empty set for the ns deps for closed source nses. The check-ns run looks like:

WARNING:File for datomic.api not found on classpath: datomic/api.clj
Not checking datomic.api (ns form missing)

Comment by Allen Rohner [ 05/Mar/15 1:02 PM ]

I got an ":ok" with the second patch on a 300 line ns that uses datomic.





[CTYP-173] (first (filter ...)) type checks in Clojure, not ClojureScript Created: 30/Aug/14  Updated: 30/Aug/14

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

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

[[org.clojure/clojure "1.6.0"]
[org.clojure/core.typed "0.2.67"]
[org.clojure/clojurescript "0.0-2322"]]



 Description   

This code type check in Clojure:

Unable to find source-code formatter for language: clj. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
(ann ffilter
  (All [a]
       [[a -> Any] (Option (Seqable a)) -> (Option a)]))

(defn ffilter
  [pred coll]
  (first (filter pred coll)))

But fails under ClojureScript with:

Type Error (typed-playground.clojurescript:26:3) Polymorphic function cljs.core/first could not be applied to arguments:
Polymorphic Variables:
x

Domains:
(clojure.core.typed/HSequential [x clojure.core.typed/Any *])
(cljs.core.typed/Option (cljs.core.typed/EmptySeqable x))
(cljs.core.typed/NonEmptySeqable x)
(cljs.core.typed/Option (cljs.core.typed/Seqable x))

Arguments:
(cljs.core/ASeq a)

Ranges:
x :object {:path [(Nth 0)], :id 0}
nil
x
(cljs.core.typed/Option x)

with expected type:
(cljs.core.typed/Option a)

in: (cljs.core/first (cljs.core/filter pred coll))
in: (cljs.core/first (cljs.core/filter pred coll))






[CTYP-172] annotating methods that descructure their arguments can confuse the type system Created: 25/Aug/14  Updated: 25/Aug/14

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

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


 Description   

In the repro case below, the two examples should be identical, but the latter causes the type system to incorrectly deduce the type of `a` and `b` to be `(U nil Number)` while it is really `Number`.

learning.core=> (cf (fn [[a b] :- (HVec [Num Num])] [(+ a b)]))
[(IFn [(HVec [Num Num]) -> (HVec [java.lang.Number]) :filters {:then tt, :else ff}]) {:then tt, :else ff}]
learning.core=> (cf (fn [[a b] :- (I (Vec Num) (ExactCount 2))] [(+ a b)]))
Type Error (/private/var/folders/34/98dbvkhn7v1clfvl5_y_fkc00001j3/T/form-init2527243481617671751.clj) Static method clojure.lang.Numbers/add could not be applied to arguments:

Domains:
java.lang.Long java.lang.Long
java.lang.Double java.lang.Double
AnyInteger AnyInteger
java.lang.Number java.lang.Number

Arguments:
(U nil Number) (U nil Number)

Ranges:
java.lang.Long
java.lang.Double
AnyInteger
java.lang.Number

in: (clojure.lang.Numbers/add a b)
in: [(clojure.lang.Numbers/add a b)]

ExceptionInfo Type Checker: Found 1 error clojure.core/ex-info (core.clj:4403)
learning.core=>






[CTYP-171] nil should not be treated as subtype of repeat list/vector Created: 22/Aug/14  Updated: 22/Aug/14

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

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

Attachments: File nil-is-not-subtype-of-repeat-list.diff    

 Description   

this patch is based on commit 35158d4340b1afda3b4073ae6efd7d6b1b08ea7e which is https://github.com/clojure/core.typed/commit/35158d4340b1afda3b4073ae6efd7d6b1b08ea7e see discuss [here](https://github.com/clojure/core.typed/pull/8#discussion-diff-16573748)






[CTYP-167] Several failure cases for comp for polyadic fns and type variables Created: 08/Aug/14  Updated: 10/Dec/14

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

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


 Description   

Description

comp doesn't work for several common uses

Literal sets can't be used, neither can the well-known identity function

> (cf (comp #{:a :b} identity)
      [Keyword -> (Option Keyword)])

    Type Error (/tmp/form-init7065637308785250377.clj:1:5) Polymorphic function comp could not be applied to arguments:
    Polymorphic Variables:
	    x
	    y
	    b
    Domains:
	    (typ/IFn [x -> y]) (typ/IFn [b ... b -> x])
    Arguments:
	    (typ/HSet #{:b :a}) (All [x] (typ/IFn [x -> x :filters {:then (! (U false nil) 0), :else (is (U false nil) 0)} :object {:id 0}]))
    Ranges:
	    (typ/IFn [b ... b -> y])
    with expected type:
	    (typ/IFn [Keyword -> (Option Keyword)])
    in: (comp #{:b :a} identity)

This seems to be a general problem with polyadic Fns

;; The return type of
> (cf (comp first first))
(typ/IFn [(U nil (I (typ/ExactCount 0) (clojure.lang.Seqable typ/Nothing))) -> nil])
;; seems to be somewhat lacking

;; using it on anything else than empty collections doesn't check
> (cf ((comp first first) []))
nil
> (cf ((comp first first) [[]]))

    Type Error (/tmp/form-init7065637308785250377.clj:1:5) Function (comp first first) could not be applied to arguments:
    Domains:
	    (U nil (I (typ/ExactCount 0) (clojure.lang.Seqable typ/Nothing)))
    Arguments:
	    (HVec [(HVec [])])
    Ranges:
	    nil
    in: ((comp first first) [[]])

;; even the very simple case of
> (cf (comp inc inc))
(typ/IFn [Long -> Long])
;; doesn't do justice 

;; to the magnificent type of
> (cf inc)
(typ/IFn [java.lang.Long -> java.lang.Long] [java.lang.Double -> java.lang.Double] [typ/AnyInteger -> typ/AnyInteger] [java.lang.Number -> java.lang.Number])


 Comments   
Comment by Oskar Wickstrom [ 10/Dec/14 11:03 PM ]

I believe I have some similar problem, but I'm not sure if it's related. I'm not that into type theory so forgive me for any weird explanations. Hope this might add some value to the discussion though.

For better readability see this gist: https://gist.github.com/owickstrom/5695e0591ef245305f27

(require '[clojure.core.typed :as t])

; This seem to work nicely
(t/cf (identity 1)) ;=> [(t/Val 123) {:then tt, :else ff}]
; And this
(t/cf pmap) ;=> (All [c a b ...] (t/IFn [[a b ... b -> c] (t/NonEmptySeqable a) (t/NonEmptySeqable b) ... b -> (t/NonEmptyASeq c)] [[a b ... b -> c] (t/U nil (Seqable a)) (t/U nil (Seqable b)) ... b -> (t/ASeq c)]))
; But when I combine the two...
(t/cf (pmap identity [1 2 3]) ;=> Type Error (/tmp/form-init5174330476817989076.clj:1:7) Polymorphic function pmap could not be applied to arguments:
; ...
; If I pmap using a non-polymorphic (?) function, at least not polymorphic in its range, it seems to work fine.
(t/cf (map println [1 2 3]) ;=>
;2
;1
;3
;(t/NonEmptyASeq nil)




[CTYP-165] GSOC 2014 Heterogeneous operations & Dotted Polymorphism Created: 02/Aug/14  Updated: 03/Aug/14

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

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

Attachments: File patch.diff    

 Description   

interface changed:

syntax:

  • add `:repeat true` to HSeq, HVec and HSequential
  • add `<*` and `<...` to Function

type:

  • Function (add prest, pdot)
  • Hsequential (add repeat attribute)
  • HSeq (add repeat attribute)
  • HVec (add repeat attribute)
  • AssocType (add dentries support)

internal function:

  • make-Function (use keyword argument instead of position argument)
  • check-fn-method1-rest-type in check.clj (add prest, pdot keyword argument)
  • merge function of parse/unparse, frees, fold, substitute-dots, substitute-dotted for HSeq, HVec and HSequential to use one function.

check result:

  • apply hash-map will now returns Map instead of HMap

docs:

  • add tutorial on inference to docs directory

built-in function annotation changed/added:

  • hash-map
  • apply
  • assoc
  • keep-indexed


 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 03/Aug/14 8:24 AM ]

I tried applying and got this error.

ambrose@ambrose-VirtualBox:~/Projects/core.typed-branches/di$ git am --keep-cr -s --ignore-whitespace < patch.diff
Applying: add :repeat field to HeterogeneousVector HeterogeneousSeq and HSequential
error: src/main/clojure/clojure/core/typed/type_rep.clj: does not exist in index
Patch failed at 0001 add :repeat field to HeterogeneousVector HeterogeneousSeq and HSequential
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

Most of the src/main files are now in module-check/src/main.

Comment by Ambrose Bonnaire-Sergeant [ 03/Aug/14 8:26 AM ]

Just looked at your branch, not really sure where this is going wrong.

Comment by Di Xu [ 03/Aug/14 8:33 AM ]

well, I'm using

git format-patch master --stdout > patch.diff

to format patch, what should I use?

Comment by Ambrose Bonnaire-Sergeant [ 03/Aug/14 8:38 AM ]

Yea that's what I would use... I don't know enough git.

Comment by Di Xu [ 03/Aug/14 9:32 AM ]

it seems [patch is not able to do this kind of work](https://stackoverflow.com/questions/2285699/git-how-to-create-patches-for-a-merge) because I merge master once in the middle of my commit sequence.

I also failed to rebase it, because you change source dir, rebase failed on my first commit.

I'm not sure how to solve it now..

Comment by Ambrose Bonnaire-Sergeant [ 03/Aug/14 9:50 AM ]

I'll just pull from your Github branch at this point.

You've included all the changes in your patch.

Comment by Di Xu [ 03/Aug/14 9:59 AM ]

ok, then.





[CTYP-143] extend & extend-protocol with (Class/forName "[B") as Class dispatch value fails Created: 12/May/14  Updated: 12/May/14

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

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


 Description   

it can be observed in this example: https://gist.github.com/mpenet/23fd53aabc853eb7e565

using extend instead of extend-protocol returns a type error:

Type Error (qbits/alia/codec.clj:75:1) Must provide
a Class or nil as first argument to extend, got
java.lang.Class

This issue in clj.core could also be of interest http://dev.clojure.org/jira/browse/CLJ-1381






[CTYP-141] Implement Difference type Created: 09/May/14  Updated: 09/May/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





[CTYP-140] HSequential things should correctly erase dotted arguments Created: 09/May/14  Updated: 09/May/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





[CTYP-133] Typechecker fails when checking involves an object from reify Created: 13/Apr/14  Updated: 25/Jul/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: 1
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



 Comments   
Comment by Jochen Hinrichsen [ 25/Jul/14 4:36 AM ]

Also on clojure 1.5.1, core.typed 0.2.65

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





[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: 1
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-113] Better documentation for override-method Created: 04/Mar/14  Updated: 15/Aug/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

Attachments: Text File 0001-Update-override-method-documentation.patch    

 Comments   
Comment by Tobias Kortkamp [ 15/Aug/14 1:32 PM ]

I've recently had to use override-method and could not find any usage examples anywhere. The doc string wasn't much help either, but I finally figured out how to use it. I've added my notes to override-method's doc string (see attached patch) in the hope that they are useful.





[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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-215] Domain of clojure.core/zero? is Number, not Any Created: 23/Apr/15  Updated: 23/Apr/15

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

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


 Description   

The annotation for clojure.core/zero? gives its type as [Any -> Boolean], but calling it with anything other than a number results in a ClassCastException. The type should probably be something like:

[Number -> Boolean :filters {:then (is (t/Val 0) 0)
                             :else (! (t/Val 0) 0)}]





[CTYP-207] Equality Propositions Created: 13/Mar/15  Updated: 13/Mar/15

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   
(is-tc-e (fn [a :- Any, b :- Boolean, c :- Int]
             (let [x (if (number? a)
                       b
                       c)]
               (if (number? a)
                 (not x)
                 (inc x)))))





[CTYP-206] Fixed as rest args Created: 13/Mar/15  Updated: 13/Mar/15

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   
(is-tc-e (fn
             ([& [a]] a))
           [x :- Any -> Any :object {:id 0}])





[CTYP-205] Better filter checking Created: 13/Mar/15  Updated: 13/Mar/15

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   

(deftest apple-test
(is-tc-e (do
(ann-datatype [[t :variance :covariant]] Apple [a :- Int])
(deftype Apple [a])
(defalias WaApple (U (Apple 'good) (Apple 'awesome)))
(defalias NWFood (U WaApple 'salmon))
(ann eat? [NWFood -> Boolean :filters {:then (is WaApple 0)
:else (! WaApple 0)}])
(defn eat? [w]
(instance? Apple w)))))






[CTYP-190] pred doesn't handle much Created: 07/Jan/15  Updated: 07/Jan/15

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

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

Clojure 1.7.0-alpha4, core.typed 0.2.77



 Description   

<pre>01:37:30 zilti: ambrosebs: Ok so ((pred HandlerComp) component) (component is a record) gives me the ":DataType not suppored in type->pred: Handler" exception at code compilation time...
01:37:56 ambrosebs: yes pred doesn't handle many things right now
01:38:19 zilti: Ah. Ok.
01:38:22 ambrosebs: worth a ticket
01:38:30 ambrosebs: I think datatypes/records can be supported</pre>






[CTYP-187] Add a defn- macro for private functions Created: 04/Jan/15  Updated: 05/Jan/15

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

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


 Description   

It would be very useful to have a "defn-" macro in core.typed so that private functions can be more easily annotated.



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 04/Jan/15 9:24 PM ]

I would much rather minimise the number of wrapper macros. I would suggest ^:private metadata w/ the "defn" macro instead.

Comment by James Reeves [ 05/Jan/15 4:36 AM ]

Usually I'd agree wholeheartedly with this sentiment. However, in many Clojure projects the majority of functions are tagged private, and I'd suggest particularly so in projects written around core.typed. Adding annotations to anonymous functions can be a little verbose to do inline, and I've found myself pulling out anonymous functions into private named functions more than I would otherwise.

Given how common private functions are, using ^:private metadata quickly becomes a verbose and tedious bit of boilerplate. While this may be a historical artifact, Clojure itself makes an exception for private functions with "defn-". It would be nice if this same exception was present in core.typed.





[CTYP-182] macros which define functions containing named anonymous functions crash Created: 09/Dec/14  Updated: 02/Jan/15

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

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


 Description   
(defmacro deft [name args & body]
  `(defn ~name []
     (fn build [] ~@body)))

(ann foo (IFn [Any nil -> Any]))
(deft foo [x] 2)

throws an exception complaining about a missing lexical environment, which can be fixed by unquote-splicing the quoted name: ~'build instead of build.

ERROR in (typecheck) (lex_env.clj:12)
expected: (check-ns (quote tesser.core))
  actual: java.lang.AssertionError: Pre-condition failure: A lexical environment l, props is a list of known propositions
Assert failed: (lex-env? l)
 at clojure.core.typed.lex_env$__GT_PropEnv$chk_PropEnv__11227$fn__11229.invoke (lex_env.clj:12)
    clojure.core.typed.lex_env$__GT_PropEnv$chk_PropEnv__11227.invoke (lex_env.clj:12)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:626)
    clojure.core$partial$fn__4228.doInvoke (core.clj:2468)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core.contracts.constraints$apply_contract$fn__1927.doInvoke (constraints.clj:174)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.core$update_in.doInvoke (core.clj:5698)
    clojure.lang.RestFn.invoke (RestFn.java:445)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.core$apply.invoke (core.clj:626)
    clojure.core.contracts.constraints$apply_contract$fn__1927.doInvoke (constraints.clj:174)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.core.typed.lex_env$merge_locals.invoke (lex_env.clj:35)
    clojure.core.typed.check.fn_methods$check_fn_methods.doInvoke (fn_methods.clj:48)
    clojure.lang.RestFn.invoke (RestFn.java:464)
    clojure.core.typed.check.fn$check_fn.invoke (fn.clj:25)
    clojure.core.typed.check$check _COLON_fn22307$fn__22317.invoke (check.clj:1282)
    clojure.core.typed.check$check _COLON_fn22307.doInvoke (check.clj:1255)
    clojure.lang.RestFn.invoke (RestFn.java:423)
    clojure.lang.MultiFn.invoke (MultiFn.java:231)
    clojure.core.typed.check$check _COLON_with_meta22482.doInvoke (check.clj:1589)
    clojure.lang.RestFn.invoke (RestFn.java:423)
    clojure.lang.MultiFn.invoke (MultiFn.java:231)
    clojure.core.typed.check.do$check_do$fn__21306$fn__21309.invoke (do.clj:40)
    clojure.core.typed.check.do$check_do$fn__21306.invoke (do.clj:32)
    clojure.lang.ArrayChunk.reduce (ArrayChunk.java:58)
    clojure.core.protocols/fn (protocols.clj:98)
    clojure.core.protocols$fn__6057$G__6052__6066.invoke (protocols.clj:19)
    clojure.core.protocols$seq_reduce.invoke (protocols.clj:31)
    clojure.core.protocols/fn (protocols.clj:54)
    clojure.core.protocols$fn__6031$G__6026__6044.invoke (protocols.clj:13)
    clojure.core$reduce.invoke (core.clj:6289)
    clojure.core.typed.check.do$check_do.invoke (do.clj:69)
    clojure.core.typed.check$check _COLON_do22363.doInvoke (check.clj:1330)
    clojure.lang.RestFn.invoke (RestFn.java:423)
    clojure.lang.MultiFn.invoke (MultiFn.java:231)
    clojure.core.typed.check.fn_method_one$check_fn_method1$fn__21492.invoke (fn_method_one.clj:179)
    clojure.core.typed.check.fn_method_one$check_fn_method1.doInvoke (fn_method_one.clj:169)
    clojure.lang.RestFn.invoke (RestFn.java:464)
    clojure.core.typed.check.fn_method$check_fn_method.doInvoke (fn_method.clj:26)
    clojure.lang.RestFn.invoke (RestFn.java:464)
    clojure.core.typed.check.fn_methods$check_fn_methods$fn__21544$fn__21551.invoke (fn_methods.clj:62)
    clojure.core$mapv$fn__6311.invoke (core.clj:6353)
    clojure.lang.ArrayChunk.reduce (ArrayChunk.java:58)
    clojure.core.protocols/fn (protocols.clj:98)
    clojure.core.protocols$fn__6057$G__6052__6066.invoke (protocols.clj:19)
    clojure.core.protocols$seq_reduce.invoke (protocols.clj:31)
    clojure.core.protocols/fn (protocols.clj:60)
    clojure.core.protocols$fn__6031$G__6026__6044.invoke (protocols.clj:13)
    clojure.core$reduce.invoke (core.clj:6289)
    clojure.core$mapv.invoke (core.clj:6353)
    clojure.core.typed.check.fn_methods$check_fn_methods$fn__21544.invoke (fn_methods.clj:60)
    clojure.core.typed.check.fn_methods$check_fn_methods.doInvoke (fn_methods.clj:45)
    clojure.lang.RestFn.invoke (RestFn.java:464)
    clojure.core.typed.check.fn$check_fn.invoke (fn.clj:25)
    clojure.core.typed.check$check _COLON_fn22307$fn__22317.invoke (check.clj:1282)
    clojure.core.typed.check$check _COLON_fn22307.doInvoke (check.clj:1255)
    clojure.lang.RestFn.invoke (RestFn.java:423)
    clojure.lang.MultiFn.invoke (MultiFn.java:231)
    clojure.core.typed.check.def$check_normal_def$fn__11342.invoke (def.clj:31)
    clojure.core.typed.check.def$check_normal_def.doInvoke (def.clj:29)
    clojure.lang.RestFn.invoke (RestFn.java:442)
    clojure.core.typed.check$check _COLON_def22496.doInvoke (check.clj:1624)
    clojure.lang.RestFn.invoke (RestFn.java:423)
    clojure.lang.MultiFn.invoke (MultiFn.java:231)
    clojure.core.typed.check$check_expr.doInvoke (check.clj:148)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.core.typed.check$check_asts$iter__21742__21746$fn__21747$fn__21748.invoke (check.clj:117)
    clojure.core.typed.check$check_asts$iter__21742__21746$fn__21747.invoke (check.clj:116)
    clojure.lang.LazySeq.sval (LazySeq.java:40)
    clojure.lang.LazySeq.seq (LazySeq.java:49)
    clojure.lang.RT.seq (RT.java:484)
    clojure.core$seq.invoke (core.clj:133)
    clojure.core$dorun.invoke (core.clj:2855)
    clojure.core$doall.invoke (core.clj:2871)
    clojure.core.typed.check$check_asts.invoke (check.clj:116)
    clojure.core.typed.check.utils$check_ns_and_deps_STAR_.invoke (utils.clj:472)
    clojure.core.typed.check$check_ns_and_deps.invoke (check.clj:128)
    clojure.core.typed.check_ns_common$check_ns_info$fn__25014$fn__25015.invoke (check_ns_common.clj:81)
    clojure.core.typed.check_ns_common$check_ns_info$fn__25014.invoke (check_ns_common.clj:57)
    clojure.lang.AFn.applyToHelper (AFn.java:152)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.core$apply.invoke (core.clj:624)
    clojure.core$with_bindings_STAR_.doInvoke (core.clj:1862)
    clojure.lang.RestFn.invoke (RestFn.java:425)
    clojure.core.typed.check_ns_common$check_ns_info.doInvoke (check_ns_common.clj:42)
    clojure.lang.RestFn.invoke (RestFn.java:425)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.core$apply.invoke (core.clj:628)
    clojure.core.typed.check_ns_common$check_ns.doInvoke (check_ns_common.clj:111)
    clojure.lang.RestFn.invoke (RestFn.java:425)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.core$apply.invoke (core.clj:628)
    clojure.core.typed.check_ns_clj$check_ns.doInvoke (check_ns_clj.clj:23)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.core$apply.invoke (core.clj:626)
    clojure.core.typed$check_ns.doInvoke (typed.clj:2225)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.core$apply.invoke (core.clj:624)
    tesser.core_test/fn (core_test.clj:19)
    clojure.test$test_var$fn__7187.invoke (test.clj:704)
    clojure.test$test_var.invoke (test.clj:704)
    clojure.test$test_vars$fn__7209$fn__7214.invoke (test.clj:722)
    clojure.test$default_fixture.invoke (test.clj:674)
    clojure.test$test_vars$fn__7209.invoke (test.clj:722)
    clojure.test$default_fixture.invoke (test.clj:674)
    clojure.test$test_vars.invoke (test.clj:718)
    clojure.test$test_all_vars.invoke (test.clj:728)
    clojure.test$test_ns.invoke (test.clj:747)
    clojure.core$map$fn__4245.invoke (core.clj:2559)
    clojure.lang.LazySeq.sval (LazySeq.java:40)
    clojure.lang.LazySeq.seq (LazySeq.java:49)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.boundedLength (RT.java:1654)
    clojure.lang.RestFn.applyTo (RestFn.java:130)
    clojure.core$apply.invoke (core.clj:626)
    clojure.test$run_tests.doInvoke (test.clj:762)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    com.aphyr.prism$autotest_BANG_$fn__228.invoke (prism.clj:130)
    com.aphyr.prism$namespace_changed$fn__209.invoke (prism.clj:90)
    com.aphyr.prism$namespace_changed.invoke (prism.clj:88)
    com.aphyr.prism$watch_BANG_$fn__214$fn__215.invoke (prism.clj:111)
    clojure.core$binding_conveyor_fn$fn__4145.invoke (core.clj:1910)
    clojure.lang.AFn.call (AFn.java:18)
    java.util.concurrent.FutureTask.run (FutureTask.java:262)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
    java.lang.Thread.run (Thread.java:745)


 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 02/Jan/15 6:48 PM ]

This is because (fn user/build ..) is valid to tools.analyzer even though it doesn't mean much.





[CTYP-181] (float)'s type is mistakenly (Any -> Float) Created: 09/Dec/14  Updated: 09/Dec/14

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

Type: Defect Priority: Minor
Reporter: Kyle Kingsbury Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   
user=> (cf float)
[Any -> java.lang.Float]
user=> (float "5")

ClassCastException java.lang.String cannot be cast to java.lang.Number  clojure.lang.RT.floatCast (RT.java:1186)





[CTYP-178] Dissimilar lengths of HVecs in a union doesn't type-check Created: 02/Dec/14  Updated: 02/Dec/14

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

Type: Defect Priority: Minor
Reporter: Edward Cho Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

[org.clojure/clojure "1.6.0"]
[org.clojure/core.typed "0.2.72"]
[org.clojure/core.match "0.2.1"]



 Description   

Setting up a simple union type for nats with a vector encoding, where the first element is the tag (:zero or :succ). The :zero constructor is nullary, but the :succ constructor recurses. The type checker doesn't seem to correctly handle union types consisting of HVecs of different lengths

The namespace:

(ns arith.core
(:require [clojure.core.typed :refer [ann defalias Rec U Val Int print-env]]
[clojure.core.match :refer [match]]))

(defalias Expr
(Rec [Expr]
(U '[(Val :zero)]
'[(Val :succ) Expr])))

(ann evaluate [Expr -> Int])
;; (defn evaluate [e]
;; (match e
;; [:zero] 0
;; [:succ t1] (inc (evaluate t1))))
;; => macroexpands to =>
(def evaluate
(fn* ([e]
(try
(if (let* [and__3973__auto__ (clojure.core/vector? e)]
(if and_3973auto_
(clojure.core/== (clojure.core/count e) 1)
and_3973auto_))
(try
(let* [e_0__45691 (clojure.core/nth e 0)]
(if (clojure.core/= e_0__45691 :zero)
0
(if :else (throw clojure.core.match/backtrack) nil)))
(catch Exception e_3853auto_
(if (clojure.core/identical? e_3853auto_ clojure.core.match/backtrack)
(do (throw clojure.core.match/backtrack))
(throw e_3853auto_))))
(if :else (throw clojure.core.match/backtrack) nil))
(catch Exception e_3853auto_
(if (clojure.core/identical? e_3853auto_ clojure.core.match/backtrack)
(do
(try
(if (let* [and__3973__auto__ (clojure.core/vector? e)]
(if and_3973auto_
(clojure.core/== (clojure.core/count e) 2)
and_3973auto_))
(try
(let* [e_0__45692 (clojure.core/nth e 0)]
(if (clojure.core/= e_0__45692 :succ) ;; type checker points here
(let* [_ (print-env "here")
t1 (clojure.core/nth e 1)]
(inc (evaluate t1)))
(if :else (throw clojure.core.match/backtrack) nil)))
(catch Exception e_3853auto_
(if (clojure.core/identical? e_3853auto_ clojure.core.match/backtrack)
(do
(throw clojure.core.match/backtrack))
(throw e_3853auto_))))
(if :else (throw clojure.core.match/backtrack) nil))
(catch Exception e_3853auto_
(if (clojure.core/identical? e_3853auto_ clojure.core.match/backtrack)
(do (throw (new java.lang.IllegalArgumentException (clojure.core/str "No matching clause: " e))))
(throw e_3853auto_)))))
(throw e_3853auto_)))))))

(comment
(clojure.core.typed/check-ns)
(evaluate [:zero])
(evaluate [:succ [:zero]])
(evaluate [:succ [:succ [:zero]]]))

The inserted print-env yields:

{:env

Unknown macro: {e_0__45692__#0 (Val }
, :props ((is (Val :succ) e_0_45692#0) (when (! (U nil false) e_045692#0) (is (clojure.core.typed/I (Seqable clojure.core.typed/Any) (clojure.core.typed/CountRange 1)) e_#0)))}

And the full stack trace:

Show: Clojure Java REPL Tooling Duplicates All (0 frames hidden)

2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling:
/Users/zerokarmaleft/Projects/tapl/tapl-clojure/arith/src/arith/core.clj:3:50

Compiler.java: 7142 clojure.lang.Compiler/load
REPL: 1 user/eval49200
Compiler.java: 6703 clojure.lang.Compiler/eval
Compiler.java: 6666 clojure.lang.Compiler/eval
core.clj: 2927 clojure.core/eval
main.clj: 239 clojure.main/repl/read-eval-print/fn
main.clj: 239 clojure.main/repl/read-eval-print
main.clj: 257 clojure.main/repl/fn
main.clj: 257 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 67 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 624 clojure.core/apply
core.clj: 1862 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 51 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 183 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj: 152 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
AFn.java: 22 clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 744 java.lang.Thread/run

1. Caused by clojure.lang.ExceptionInfo
Type Checker: Found 1 error
{:type-error :top-level-error,
:errors
(#<ExceptionInfo clojure.lang.ExceptionInfo: Internal Error (arith/core.clj:43:27) Cannot get index 1 from type (clojure.core.typed/HVec [(clojure.core.typed/Val :zero)]) {:type-error :clojure.core.typed.errors/internal-error, :env {:no-recur true, :loop-locals 1, :locals {e {:form e, :name e_#0, :variadic? false, :op :binding, :arg-id 0, :local :arg}, e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto__#1, :local :catch, :tag Exception}, e_045692 {:op :binding, :name e_045692_#0, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e_3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0_45692, :local :let, :children [:init]}, _ {:op :binding, :name ___#0, :init {:children [:fn :args], :meta {:end-column 56, :end-line 44, :column 38, :line 44, :file "arith/core.clj"}, :op :invoke, :form (print-env "here"), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e_0_45692 {:op :binding, :name e_0_45692, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e_3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0_45692, :local :let, :children [:init]}, e_3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :fn {:form print-env, :env {:in-try true, :no-recur true, :once false, :context :ctx.invoke/target, :locals {e_045692 {:op :binding, :name e_0_45692, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e_3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0_45692, :local :let, :children [:init]}, e_3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :var, :assignable? false, :var #'clojure.core.typed/print-env}, :args [{:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx.invoke/param, :locals {e_045692 {:op :binding, :name e_0_45692, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e_3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e3853auto_ {:op :binding, :form e_3853auto, :name e3853auto, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0_45692, :local :let, :children [:init]}, e_3853auto_ {:op :binding, :form e_3853auto, :name e3853auto_, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :string, :literal? true, :val "here", :form "here"}]}, :form _, :local :let, :children [:init]}}, :ns arith.core, :loop-id loop_49240, :file "arith/core.clj", :end-column 61, :column 39, :in-try true, :line 45, :once false, :end-line 45, :context :ctx/expr, :internal-name "evaluate$fn__49242$t1"}}>)}

core.clj: 4403 clojure.core/ex-info
errors.clj: 232 clojure.core.typed.errors/print-errors!
check_ns_common.clj: 114 clojure.core.typed.check-ns-common/check-ns/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 624 clojure.core/apply
core.clj: 1862 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
check_ns_common.clj: 112 clojure.core.typed.check-ns-common/check-ns
RestFn.java: 425 clojure.lang.RestFn/invoke
AFn.java: 156 clojure.lang.AFn/applyToHelper
RestFn.java: 132 clojure.lang.RestFn/applyTo
core.clj: 628 clojure.core/apply
check_ns_clj.clj: 23 clojure.core.typed.check-ns-clj/check-ns
RestFn.java: 410 clojure.lang.RestFn/invoke
AFn.java: 154 clojure.lang.AFn/applyToHelper
RestFn.java: 132 clojure.lang.RestFn/applyTo
core.clj: 626 clojure.core/apply
typed.clj: 2225 clojure.core.typed/check-ns
RestFn.java: 410 clojure.lang.RestFn/invoke
typed.clj: 2222 clojure.core.typed/check-ns
core.clj: 61 arith.core/eval49212
Compiler.java: 6703 clojure.lang.Compiler/eval
Compiler.java: 7130 clojure.lang.Compiler/load
REPL: 1 user/eval49200
Compiler.java: 6703 clojure.lang.Compiler/eval
Compiler.java: 6666 clojure.lang.Compiler/eval
core.clj: 2927 clojure.core/eval
main.clj: 239 clojure.main/repl/read-eval-print/fn
main.clj: 239 clojure.main/repl/read-eval-print
main.clj: 257 clojure.main/repl/fn
main.clj: 257 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 67 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 624 clojure.core/apply
core.clj: 1862 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 51 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 183 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj: 152 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
AFn.java: 22 clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 744 java.lang.Thread/run



 Comments   
Comment by Edward Cho [ 02/Dec/14 2:49 PM ]

Sorry, forgot JIRA eats formatting.

(ns arith.core
  (:require [clojure.core.typed :refer [ann defalias Rec U Val Int print-env]]
            [clojure.core.match :refer [match]]))

(defalias Expr
  (Rec [Expr]
    (U '[(Val :zero)]
       '[(Val :succ) Expr])))

(ann evaluate [Expr -> Int])
;; (defn evaluate [e]
;;   (match e
;;     [:zero]    0
;;     [:succ t1] (inc (evaluate t1))))
;; => macroexpands to =>
(def evaluate
  (fn* ([e]
          (try
            (if (let* [and__3973__auto__ (clojure.core/vector? e)]
                  (if and__3973__auto__
                    (clojure.core/== (clojure.core/count e) 1)
                    and__3973__auto__))
              (try
                (let* [e_0__45691 (clojure.core/nth e 0)]
                  (if (clojure.core/= e_0__45691 :zero)
                    0
                    (if :else (throw clojure.core.match/backtrack) nil)))
                (catch Exception e__3853__auto__
                  (if (clojure.core/identical? e__3853__auto__ clojure.core.match/backtrack)
                    (do (throw clojure.core.match/backtrack))
                    (throw e__3853__auto__))))
              (if :else (throw clojure.core.match/backtrack) nil))
            (catch Exception e__3853__auto__
              (if (clojure.core/identical? e__3853__auto__ clojure.core.match/backtrack)
                (do
                  (try
                    (if (let* [and__3973__auto__ (clojure.core/vector? e)]
                          (if and__3973__auto__
                            (clojure.core/== (clojure.core/count e) 2)
                            and__3973__auto__))
                      (try
                        (let* [e_0__45692 (clojure.core/nth e 0)]
                          (if (clojure.core/= e_0__45692 :succ)
                            (let* [_ (print-env "here")
                                   t1 (clojure.core/nth e 1)]
                                  (inc (evaluate t1)))
                            (if :else (throw clojure.core.match/backtrack) nil)))
                        (catch Exception e__3853__auto__
                          (if (clojure.core/identical? e__3853__auto__ clojure.core.match/backtrack)
                            (do
                              (throw clojure.core.match/backtrack))
                            (throw e__3853__auto__))))
                      (if :else (throw clojure.core.match/backtrack) nil))
                    (catch Exception e__3853__auto__
                      (if (clojure.core/identical? e__3853__auto__ clojure.core.match/backtrack)
                        (do (throw (new java.lang.IllegalArgumentException (clojure.core/str "No matching clause: " e))))
                        (throw e__3853__auto__)))))
                (throw e__3853__auto__)))))))

(comment
  (clojure.core.typed/check-ns)
  (evaluate [:zero])
  (evaluate [:succ [:zero]])
  (evaluate [:succ [:succ [:zero]]]))
{:env {e_0__45692__#0 (Val :succ), 
       e__3853__auto____#1 Exception, 
       e__#0 Expr}, 
 :props ((is (Val :succ) e_0__45692__#0) 
         (when (! (U nil false) e_0__45692__#0) 
               (is (clojure.core.typed/I (Seqable clojure.core.typed/Any) (clojure.core.typed/CountRange 1)) e__#0)))}
(#<ExceptionInfo clojure.lang.ExceptionInfo: Internal Error (arith/core.clj:43:27) Cannot get index 1 from type (clojure.core.typed/HVec [(clojure.core.typed/Val :zero)]) {:type-error :clojure.core.typed.errors/internal-error, :env {:no-recur true, :loop-locals 1, :locals {e {:form e, :name e__#0, :variadic? false, :op :binding, :arg-id 0, :local :arg}, e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto____#1, :local :catch, :tag Exception}, e_0__45692 {:op :binding, :name e_0__45692__#0, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0__45692, :local :let, :children [:init]}, _ {:op :binding, :name ___#0, :init {:children [:fn :args], :meta {:end-column 56, :end-line 44, :column 38, :line 44, :file "arith/core.clj"}, :op :invoke, :form (print-env "here"), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e_0__45692 {:op :binding, :name e_0__45692, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0__45692, :local :let, :children [:init]}, e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :fn {:form print-env, :env {:in-try true, :no-recur true, :once false, :context :ctx.invoke/target, :locals {e_0__45692 {:op :binding, :name e_0__45692, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0__45692, :local :let, :children [:init]}, e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :var, :assignable? false, :var #'clojure.core.typed/print-env}, :args [{:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx.invoke/param, :locals {e_0__45692 {:op :binding, :name e_0__45692, :init {:raw-forms ((clojure.core/nth e 0)), :children [:target :args], :args [{:env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :children [], :assignable? false, :form e, :name e, :variadic? false, :op :local, :arg-id 0, :local :arg} {:op :const, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :number, :literal? true, :val 0, :form 0}], :method nth, :op :host-call, :form (. clojure.lang.RT (clojure.core/nth e 0)), :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :target {:form clojure.lang.RT, :env {:in-try true, :no-recur true, :once false, :context :ctx/expr, :locals {e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :op :maybe-class, :class clojure.lang.RT}}, :form e_0__45692, :local :let, :children [:init]}, e__3853__auto__ {:op :binding, :form e__3853__auto__, :name e__3853__auto__, :local :catch, :tag Exception}, e {:form e, :name e, :variadic? false, :op :binding, :arg-id 0, :local :arg}}, :ns arith.core, :loop-id loop_49240, :loop-locals 1}, :type :string, :literal? true, :val "here", :form "here"}]}, :form _, :local :let, :children [:init]}}, :ns arith.core, :loop-id loop_49240, :file "arith/core.clj", :end-column 61, :column 39, :in-try true, :line 45, :once false, :end-line 45, :context :ctx/expr, :internal-name "evaluate$fn__49242$t1"}}>)}




[CTYP-170] `(apply concat ...)` gives "AssertionError Assert failed: (r/HeterogeneousMap? kws)". Created: 19/Aug/14  Updated: 19/Aug/14

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

Type: Defect Priority: Minor
Reporter: Tim Dixon Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 0
Labels: None
Environment:

OS X, Clojure 1.6.0, core.typed 0.2.66


Attachments: File core.clj     GZip Archive deployer-bug.tar.gz    

 Description   

Trying to type-check `(apply concat [])` or even `(apply concat [["a"] ["b"]])` gives me "AssertionError Assert failed: (r/HeterogeneousMap? kws) clojure.core.typed.type-ctors/HMap->KwArgsSeq (type_ctors.clj:2101)".

Minimal failing example is attached, as well as a tarball of a small project that can be `lein run` to illustrate the error.

Thanks!






[CTYP-168] :arglists metadata is missing from vars defined using core.typed's defn macro Created: 12/Aug/14  Updated: 04/Jan/15

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

Type: Defect Priority: Minor
Reporter: Tobias Kortkamp Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 1
Labels: None

Attachments: Text File 0001-Add-arglists-metadata-to-vars-defined-using-defn.patch     Text File 0002-Add-arglists-metadata-to-vars-defined-using-defn.patch     Text File 0003-Add-arglists-and-attr-map-support-to-defn.patch    
Patch: Code

 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).



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 12/Aug/14 11:41 AM ]

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

Comment by Ambrose Bonnaire-Sergeant [ 12/Aug/14 11:41 AM ]

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

Comment by Ambrose Bonnaire-Sergeant [ 12/Aug/14 11:43 AM ]

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

Comment by Tobias Kortkamp [ 12/Aug/14 12:15 PM ]

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

Comment by Tobias Kortkamp [ 12/Aug/14 11:14 PM ]

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.

Comment by James Reeves [ 04/Jan/15 8:47 PM ]

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





[CTYP-160] Correctly check IFn ancestor with type/record Created: 04/Jul/14  Updated: 04/Jul/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   

Extending type/record to IFn should be able to verify a type like (IFn [Num -> Num).






[CTYP-156] Add special arities to `nth` if we know exactly the index argument and CountRange Created: 15/Jun/14  Updated: 15/Jun/14

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

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

Attachments: Text File 0001-Add-special-arities-to-nth-if-we-know-exactly-the-in.patch    
Patch: Code and Test

 Description   

(nth (I (Coll Integer) (CountRange 1)) 0 x) should always return Integer, not (U Integer x)






[CTYP-139] Extend what can used as HMap key Created: 07/May/14  Updated: 07/May/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 model how `equiv` works at the type level for HMap keys. It would be nice if we can define equality for custom defrecord/deftype's.

This will help understand Schema definitions automatically.






[CTYP-138] Support mutually recursive types Created: 07/May/14  Updated: 07/May/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   

Some notes from asumu: https://botbot.me/freenode/racket/msg/14338467/






[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-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-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-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-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-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: 1
Labels: None


 Description   

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






[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-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-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-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-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-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-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-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-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-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-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.






Generated at Sat Apr 25 20:32:46 CDT 2015 using JIRA 4.4#649-r158309.