You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2015/10/10 08:35:09 UTC
[jira] [Updated] (GROOVY-4421) Casts should have higher precedence
than mathematical operators
[ https://issues.apache.org/jira/browse/GROOVY-4421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pascal Schumacher updated GROOVY-4421:
--------------------------------------
Issue Type: Bug (was: Sub-task)
Parent: (was: GROOVY-5299)
> Casts should have higher precedence than mathematical operators
> ---------------------------------------------------------------
>
> Key: GROOVY-4421
> URL: https://issues.apache.org/jira/browse/GROOVY-4421
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 1.7.4
> Reporter: Jeffrey Adamson
> Assignee: Paul King
> Fix For: 2.4.4
>
>
> The following test case executes successfully when compiled+executed as java. However it throws the exception "Cannot use mod() on this number type: java.math.BigDecimal with value: 10.7" when executed as groovy.
> {code:java}
> public class TesCastPrecedence {
> @org.junit.Test
> public void testCastWithMod() {
> long result = (long)10.7 % 3L;
> System.out.println(result);
> org.junit.Assert.assertEquals(result, 1L);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)