<< Back to previous view

[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






Generated at Tue Jan 27 02:32:59 CST 2015 using JIRA 4.4#649-r158309.