You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Fabiano Biagini (JIRA)" <ji...@apache.org> on 2016/01/13 22:48:39 UTC

[jira] [Created] (GROOVY-7729) STC error on array range sum plus costant

Fabiano Biagini created GROOVY-7729:
---------------------------------------

             Summary: STC error on array range sum plus costant
                 Key: GROOVY-7729
                 URL: https://issues.apache.org/jira/browse/GROOVY-7729
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 2.4.5, 2.4.4
         Environment: JDK 1.8.0_51/win32
            Reporter: Fabiano Biagini


{noformat}
@groovy.transform.CompileStatic
void bug() {
    int[] a=[1,2,3]
    println a[0..1].sum()+5
}
{noformat}

The code above works correctly with CompileDynamic, but CompileStatic will produce the following error:

{noformat}
[Static type checking] - Cannot find matching method java.lang.Object#plus(int). 
{noformat}



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