Hi,
I got his error from Groovy 2.3.0 beta3
from the following code snippet at the highlighted line
double doFitness(List <Integer> board) {
List <Integer> leftDiagonal = new ArrayList(2*N)
List <Integer> rightDiagonal = new ArrayList(2*N)
double sum = 0.0D
for ( i in 1 .. 2*N) {
leftDiagonal[i] = 0
rightDiagonal[i] = 0
}
for ( i in 1 .. N) {
leftDiagonal[i+board[i]-1]++
rightDiagonal[N-i+board[i]]++
}
for ( i in 1 .. ((2*N) - 1)) {
int counter = 0
if ( leftDiagonal[i] > 1)
counter += leftDiagonal[i] - 1
if ( rightDiagonal[i] > 1)
counter += rightDiagonal[i] - 1
sum += counter / (N - Math.abs(i-N))
}
// target fitness is 0.0
// sum can be negative so return absolute value
return Math.abs(sum)
}
Error:Groovyc: While compiling gppDemos: BUG! exception in phase 'class
generation' in source unit
'D:\IJgroovy\gpp\gppDemos\src\gppDemos\nQueensProblem\QueensClient.groovy' At
line 70 column 13
On receiver: leftDiagonal with message: getAt and arguments: <not implemented
yet for class: org.codehaus.groovy.classgen.asm.VariableSlotLoader>
This method should not have been called. Please try to create a simple example
reproducing
this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY
at
org.codehaus.groovy.classgen.asm.sc.StaticTypesCallSiteWriter.makeSingleArgumentCall(StaticTypesCallSiteWriter.java:682)
at
org.codehaus.groovy.classgen.asm.InvocationWriter.makeSingleArgumentCall(InvocationWriter.java:654)
at
org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateBinaryExpression(BinaryExpressionHelper.java:574)
at
org.codehaus.groovy.classgen.asm.BinaryExpressionMultiTypeDispatcher.evaluateBinaryExpression(BinaryExpressionMultiTypeDispatcher.java:204)
at
org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper.java:290)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:698)
at
org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
at
org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.loadWithSubscript(BinaryExpressionHelper.java:730)
at
org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluatePostfixMethod(BinaryExpressionHelper.java:658)
at
org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluatePostfixMethod(BinaryExpressionHelper.java:681)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitPostfixExpression(AsmClassGenerator.java:703)
at
org.codehaus.groovy.ast.expr.PostfixExpression.visit(PostfixExpression.java:45)
at
org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:621)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:680)
at
org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
at
org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:93)
at
org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:83)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:626)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at
org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeIteratorBasedForEachLoop(StaticTypesStatementWriter.java:254)
at
org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeForInLoop(StaticTypesStatementWriter.java:109)
at
org.codehaus.groovy.classgen.asm.StatementWriter.writeForStatement(StatementWriter.java:105)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitForLoop(AsmClassGenerator.java:630)
at org.codehaus.groovy.ast.stmt.ForStatement.visit(ForStatement.java:49)
at
org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:93)
at
org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:83)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:626)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:110)
at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:121)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:486)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:422)
at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:567)
at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1087)
at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
at
org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:260)
at
org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:853)
at
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1090)
at
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:634)
at
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:612)
at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:589)
at
org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62)
at
org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:158)
at
org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:88)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Professor Jon Kerridge
School of Computing
Edinburgh Napier University
Merchiston Campus
Edinburgh EH10 5DT
0131 455 2777
[email protected]<mailto:[email protected]>
http://www.soc.napier.ac.uk/~cs10/
This message and its attachment(s) are intended for the addressee(s) only and
should not be read, copied, disclosed, forwarded or relied upon by any person
other than the intended addressee(s) without the permission of the sender. If
you are not the intended addressee you must not take any action based on this
message and its attachment(s) nor must you copy or show them to anyone. Please
respond to the sender and ensure that this message and its attachment(s) are
deleted.
It is your responsibility to ensure that this message and its attachment(s) are
scanned for viruses or other defects. Edinburgh Napier University does not
accept liability for any loss or damage which may result from this message or
its attachment(s), or for errors or omissions arising after it was sent. Email
is not a secure medium. Emails entering Edinburgh Napier University's system
are subject to routine monitoring and filtering by Edinburgh Napier University.
Edinburgh Napier University is a registered Scottish charity. Registration
number SC018373