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:05 UTC
[jira] [Updated] (GROOVY-5185) Cast operator precedence is
incorrect
[ https://issues.apache.org/jira/browse/GROOVY-5185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pascal Schumacher updated GROOVY-5185:
--------------------------------------
Issue Type: Bug (was: Sub-task)
Parent: (was: GROOVY-5299)
> Cast operator precedence is incorrect
> -------------------------------------
>
> Key: GROOVY-5185
> URL: https://issues.apache.org/jira/browse/GROOVY-5185
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 1.8.4
> Reporter: Cédric Champeau
> Assignee: Paul King
> Labels: breaking_change
> Fix For: 2.4.4
>
>
> 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)