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

Compiler error for @CompileStatic and @NotYetImplemented combination

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.13
    • 2.5.9, 3.0.0-rc-2
    • Compiler
    • None

    Description

      The following test class snippet results in a groovy compiler error (included below).

      import groovy.transform.*
      import org.junit.Test
      
      @CompileStatic
      final class Tests {
        private def helper(String string, int number = 1) {
        }
      
        @Test @NotYetImplemented
        void testSomething() {
          helper('abc', 123)
        }
      }
      
      BUG! exception in phase 'class generation' in source unit '...\Groovy\src\test\BugTest.groovy' Error while popping argument from operand stack tracker in class Tests method void testSomething().
      	at org.codehaus.groovy.classgen.asm.OperandStack.popWithMessage(OperandStack.java:72)
      	at org.codehaus.groovy.classgen.asm.OperandStack.remove(OperandStack.java:207)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeThrow(StatementWriter.java:572)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitThrowStatement(AsmClassGenerator.java:643)
      	at org.codehaus.groovy.ast.stmt.ThrowStatement.visit(ThrowStatement.java:43)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:85)
      	at org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:65)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:597)
      	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:147)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:158)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:461)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:414)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:169)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:538)
      	at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1201)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:55)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:260)
      	at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:847)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1129)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:620)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:598)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:575)
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h