<< Back to previous view

[CLJ-439] Automatic type translation from Integer to Long Created: 27/Sep/10  Updated: 28/Sep/10  Resolved: 28/Sep/10

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: Release 1.3

Type: Defect
Reporter: Anonymous Assignee: Rich Hickey
Resolution: Completed Votes: 0
Labels: None


 Description   

In some cases types can get lost:

(def i1 (Integer. "100"))
(def i2 (Integer/valueOf 100))

[(class i1) (class i2)]
==> [java.lang.Integer java.lang.Long]

;; expected ==> [java.lang.Integer java.lang.Integer]

;; But: (class (Integer/valueOf 100)) ==> java.lang.Integer

Works correspondingly for Floats, which become Doubles.



 Comments   
Comment by Assembla Importer [ 28/Sep/10 1:39 PM ]

Converted from http://www.assembla.com/spaces/clojure/tickets/439

Comment by Assembla Importer [ 28/Sep/10 1:39 PM ]

richhickey said: (In [[r:cc8372f12074b4cccbdd9cde3cfacfae069c57d3]]) don't coerce pre-boxed Integers and Floats to Longs/Doubles, fixes #439

Branch: master

Generated at Mon Sep 01 18:42:25 CDT 2014 using JIRA 4.4#649-r158309.