primitive type hints do not work when destructuring

192 views
Skip to first unread message

Sergey Didenko

unread,
Nov 2, 2011, 6:40:34 AM11/2/11
to clo...@googlegroups.com
Seems like a bug:

The following compiles:

(let [[^Double x ^Double y] [0.1 0.2]] (+ x y))

This does not:

(let [[^double x ^double y] [0.1 0.2]] (+ x y))

"Unable to resolve classname: double"

Sergey Didenko

unread,
Nov 2, 2011, 6:41:10 AM11/2/11
to clo...@googlegroups.com
tested under Clojure 1.3

bsmith.occs

unread,
Nov 2, 2011, 7:11:16 AM11/2/11
to Clojure
This is CLJ-852. Applying the patch posted there on top of current
master fixes the problem:

$ curl http://dev.clojure.org/jira/secure/attachment/10398/CLJ-852-test.patch
| git am -
...
$ curl http://dev.clojure.org/jira/secure/attachment/10401/CLJ-852-rfc-fix.patch
| git am -
...
$ mvn packge
...
$ java -jar target/clojure-1.4.0-master-SNAPSHOT.jar
Clojure 1.4.0-master-SNAPSHOT
(let [[^double x ^double y] [0.1 0.2]] (+ x y))
0.30000000000000004

// Ben
Reply all
Reply to author
Forward
0 new messages