You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2015/06/23 07:41:00 UTC

[jira] [Assigned] (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 ]

Paul King reassigned GROOVY-4421:
---------------------------------

    Assignee: Paul King

> Casts should have higher precedence than mathematical operators
> ---------------------------------------------------------------
>
>                 Key: GROOVY-4421
>                 URL: https://issues.apache.org/jira/browse/GROOVY-4421
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: Compiler
>    Affects Versions: 1.7.4
>            Reporter: Jeffrey Adamson
>            Assignee: Paul King
>
> 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)