groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-5185) Cast operator precedence is incorrect
Date Tue, 09 Jun 2015 10:50:07 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-5185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14578714#comment-14578714
] 

Paul King commented on GROOVY-5185:
-----------------------------------

Is this a duplicate of GROOVY-4421?

> Cast operator precedence is incorrect
> -------------------------------------
>
>                 Key: GROOVY-5185
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5185
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: groovy-runtime
>    Affects Versions: 1.8.4
>            Reporter: C├ędric Champeau
>
> The cast operator precedence is incorrect:
> {code}
> def i = (int)1/(int)2
> assert i.class==BigDecimal // fails
> {code}
> To have proper casts, we need extra parenthesis which should not be necessary:
> {code}
> def i = ((int)1)/((int)2)
> assert i.class==BigDecimal // ok
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message