Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.6
-
Fix Version/s: 1.6.1, 1.5.8, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
while this works:
groovy> long d = 100L
groovy> d = d / 33L
groovy> d.class
Result: class java.lang.Long
the following breaks the type system and produces a Long that is a BigDecimal!
groovy> long d = 100L
groovy> d /= 33L
groovy> d.class
Result: class java.math.BigDecimal
Issue Links
- relates to
-
GROOVY-2665
static typing issue: adding a string to an Integer
-
long divided by long returns a BigDecimal in Groovy, this part is ok. What happens on the assignment is that the BigDecimal is converted into a long. This part is missing for /= it seems. So it is not a critical bug, but it is a bug