core.typed

Heterogeneous Vector is not ISeqable in CLJS

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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)

Activity

There are no entries against this issue.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: