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

Fabiano Biagini updated GROOVY-7729:
------------------------------------
    Summary: STC error on int range sum  (was: STC error on array range sum 
plus costant)

> STC error on int range sum
> --------------------------
>
>                 Key: GROOVY-7729
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7729
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>    Affects Versions: 2.4.4, 2.4.5
>         Environment: JDK 1.8.0_51/win32
>            Reporter: Fabiano Biagini
>            Priority: Minor
>
> {noformat}
> @groovy.transform.CompileStatic
> void bug() {
>     int[] a = [1,2,3]
>     int b = a[0..2].sum()
> }
> {noformat}
> The code above works correctly with CompileDynamic, but CompileStatic will 
> produce the following error:
> {noformat}
> [Static type checking] - Cannot assign value of type java.lang.Object to 
> variable of type int
> {noformat}
> Seems to be a problem of DefaultGroovyMethods.sum



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

Reply via email to