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

Compiler crash in the static type checker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.2, 2.4.3
    • 2.4.4
    • Static Type Checker
    • None

    Description

      My project doesn't build when upgrading from 2.4.1 to 2.4.2 or 2.4.3, crashing in the static type checker with:

      java.lang.ArrayIndexOutOfBoundsException: 1
      at org.codehaus.groovy.ast.tools.GenericsUtils.extractPlaceholders(GenericsUtils.java:164)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.inferReturnTypeGenerics(StaticTypeCheckingVisitor.java:4152)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1238)
      at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:419)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1132)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:494)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpression(StaticTypeCheckingVisitor.java:499)
      at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitPropertyExpression(StaticCompilationVisitor.java:433)
      at org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:55)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:545)
      at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)
      at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:69)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:193)
      at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
      at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163)
      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.transform.stc.StaticTypeCheckingVisitor.visitConstructorOrMethod(StaticTypeCheckingVisitor.java:1756)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.startMethodInference(StaticTypeCheckingVisitor.java:2089)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethod(StaticTypeCheckingVisitor.java:2048)
      at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethod(StaticCompilationVisitor.java:160)
      at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1083)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
      at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClass(StaticTypeCheckingVisitor.java:244)
      at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitClass(StaticCompilationVisitor.java:119)
      at org.codehaus.groovy.transform.sc.StaticCompileTransformation.visit(StaticCompileTransformation.java:60)
      at org.codehaus.groovy.transform.ASTTransformationVisitor.visitClass(ASTTransformationVisitor.java:132)
      at org.codehaus.groovy.transform.ASTTransformationVisitor$2.call(ASTTransformationVisitor.java:176)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1052)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:588)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:522)
      ...
      

      I'll try to run the compiler in the debugger to find the class triggering the error, so I can extract a proper test case.

      Attachments

        Activity

          People

            melix Cédric Champeau
            fpavageau Frank Pavageau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: