ajwang / groovypptest

Automatically exported from code.google.com/p/groovypptest
0 stars 0 forks source link

Use of @Field causes "Internal Error: java.lang.ArrayIndexOutOfBoundsException: -1" #310

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
----------------------------------
@Typed package test
def foo() {
    @Field f1 = 5
    @Field f2 = f1 + 1

    assert f1 == 5 
    assert f2 == 6
}

foo()
----------------------------------

results in
--------------------------------------------------------------------
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
D:\Roshan\GroovyDevSetup\Workspace17x\TryGPP\src\TryGroovy.groovy: -1: Internal 
Error: java.lang.ArrayIndexOutOfBoundsException: -1
 @ line -1, column -1.org.codehaus.groovy.syntax.SyntaxException: Internal Error: java.lang.ArrayIndexOutOfBoundsException: -1
 @ line -1, column -1.
    at org.mbte.groovypp.compiler.CompilerTransformer.addError(CompilerTransformer.java:92)
    at org.mbte.groovypp.compiler.StaticMethodBytecode.<init>(StaticMethodBytecode.java:84)
    at org.mbte.groovypp.compiler.StaticMethodBytecode.replaceMethodCode(StaticMethodBytecode.java:98)
    at org.mbte.groovypp.compiler.CompileASTTransform.visit(CompileASTTransform.java:108)
....
....
....
--------------------------------------------------------------------

Original issue reported on code.google.com by roshanda...@gmail.com on 17 Oct 2010 at 6:38

GoogleCodeExporter commented 8 years ago

Original comment by alex.tka...@gmail.com on 17 Oct 2010 at 6:58