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

return <newline> value - throws exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0-JSR-2
    • None
    • None
    • cvs head on march 19th

    Description

      [m@h groovy]$ cat bug_return_with_newline.groovy
      x =

      {return // note the newline here 4}

      [m@h groovy]$ groovy bug_return_with_newline.groovy
      Caught: org.codehaus.groovy.classgen.ClassGeneratorException: Cannot generate bytecode for constant: class java.lang.Void of type: java.lang.Class
      org.codehaus.groovy.classgen.ClassGeneratorException: Cannot generate bytecode for constant: class java.lang.Void of type: java.lang.Class
      at org.codehaus.groovy.classgen.ClassGenerator.visitConstantExpression(ClassGenerator.java:1258)
      at org.codehaus.groovy.ast.expr.ConstantExpression.visit(ConstantExpression.java:75)
      at org.codehaus.groovy.classgen.ClassGenerator.visitAndAutobox(ClassGenerator.java:2520)
      at org.codehaus.groovy.classgen.ClassGenerator.evaluateExpression(ClassGenerator.java:929)
      at org.codehaus.groovy.classgen.ClassGenerator.visitReturnStatement(ClassGenerator.java:861)
      at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:70)
      at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:108)
      at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:79)
      at org.codehaus.groovy.classgen.ClassGenerator.visitMethod(ClassGenerator.java:336)
      at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:688)
      at org.codehaus.groovy.classgen.ClassGenerator.visitClass(ClassGenerator.java:268)
      at org.codehaus.groovy.classgen.CompilerFacade.generateClass(CompilerFacade.java:118)
      at org.codehaus.groovy.classgen.CompilerFacade.generateClass(CompilerFacade.java:141)
      at org.codehaus.groovy.classgen.CompilerFacade.parseClass(CompilerFacade.java:162)
      at org.codehaus.groovy.classgen.CompilerFacade.parseClass(CompilerFacade.java:87)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:154)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:108)
      at groovy.lang.GroovyShell.run(GroovyShell.java:182)
      at groovy.lang.GroovyShell.main(GroovyShell.java:88)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            morgan morgan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: