Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6565

BUG! exception in phase 'class generation' in source unit 'ideaGroovyConsole.groovy' Error while popping argument from operand stack tracker in class Test method void <init>()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: class generator
    • Labels:
      None

      Description

      @groovy.transform.CompileStatic
      class Test {
      Test()

      { Map<String, Integer> test = new HashMap<>([a : 0, b : 5]); test["b"]--; //println test }

      }

      new Test()
      BUG! exception in phase 'class generation' in source unit 'ideaGroovyConsole.groovy' Error while popping argument from operand stack tracker in class Test method void <init>().
      at org.codehaus.groovy.classgen.asm.OperandStack.popWithMessage(OperandStack.java:74)
      at org.codehaus.groovy.classgen.asm.OperandStack.remove(OperandStack.java:215)
      at org.codehaus.groovy.classgen.asm.sc.StaticInvocationWriter.writeDirectMethodCall(StaticInvocationWriter.java:187)
      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeDirectCall(InvocationWriter.java:243)
      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:342)
      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:89)
      at org.codehaus.groovy.classgen.asm.sc.StaticInvocationWriter.makeCall(StaticInvocationWriter.java:498)
      at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:73)
      at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:412)
      at org.codehaus.groovy.classgen.asm.sc.StaticInvocationWriter.writeInvokeMethod(StaticInvocationWriter.java:87)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:686)
      at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:64)
      at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.loadWithSubscript(BinaryExpressionHelper.java:680)
      at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluatePostfixMethod(BinaryExpressionHelper.java:602)
      at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluatePostfixMethod(BinaryExpressionHelper.java:628)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitPostfixExpression(AsmClassGenerator.java:570)
      at org.codehaus.groovy.ast.expr.PostfixExpression.visit(PostfixExpression.java:43)
      at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:604)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:547)
      at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
      at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:81)
      at org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:49)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:493)
      at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:357)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:314)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructor(ClassCodeVisitorSupport.java:119)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructor(AsmClassGenerator.java:429)
      at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1051)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
      at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:177)
      at org.codehaus.groovy.control.CompilationUnit$15.call(CompilationUnit.java:794)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1036)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:572)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:550)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:527)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:613)
      at groovy.lang.GroovyShell.run(GroovyShell.java:480)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:231)
      at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
      at console.run(console.txt:25)

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              bsideup Sergei Egorov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: