<< Back to previous view

[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: 13/Apr/14

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

Type: Defect Priority: Major
Reporter: Daniel Ziltener Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 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






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

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

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

core.typed 0.2.40



 Description   

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

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

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

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

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






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

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

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





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





Generated at Tue Jul 22 22:57:40 CDT 2014 using JIRA 4.4#649-r158309.