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/12 20:29:05 UTC

[jira] [Closed] (GROOVY-7505) Change In cast operator precedence

     [ https://issues.apache.org/jira/browse/GROOVY-7505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pascal Schumacher closed GROOVY-7505.
-------------------------------------
    Resolution: Not A Problem

No discussion on the mailing list was started and according to  [https://github.com/grails/grails-core/commit/b392488ca376fc5f1b132542f9e7e31f99c8b3c0] Grails 3.0.x updated to Groovy 2.4.5. Therefore I'm closing this issue.

> Change In cast operator precedence
> ----------------------------------
>
>                 Key: GROOVY-7505
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7505
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>            Reporter: Jeff Scott Brown
>            Assignee: Cédric Champeau
>
> The following code compiles with Groovy 2.4.3 and will not compile with Groovy 2.4.4.
> {code:title=Demo.groovy|borderStyle=solid}
> import groovy.transform.CompileStatic
> @CompileStatic
> class Demo {
>     String[] getStrings(boolean b) {
>         (String[]) b ? methodOne() : methodTwo()
>     }
>     String[] methodOne() {
>         ['Chris Squire'] as String[]
>     }
>     String[] methodTwo() {
>         ['Chris Squire'] as String[]
>     }
> }
> {code}
> {noformat}
> /Users/jeff/expressionquestion/src/main/groovy/demo/Demo.groovy: 9: [Static type checking] - Inconvertible types: cannot cast boolean to java.lang.String[]
>  @ line 9, column 9.
>            (String[]) b ? methodOne() : methodTwo()
>            ^
> 1 error
> :compileGroovy FAILED
> FAILURE: Build failed with an exception.
> {noformat}
> Is that intentional?



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