groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patric Bechtel (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-8753) Compiler error in STC: exception in phase 'instruction selection'
Date Fri, 17 Aug 2018 22:25:00 GMT
Patric Bechtel created GROOVY-8753:
--------------------------------------

             Summary: Compiler error in STC: exception in phase 'instruction selection'
                 Key: GROOVY-8753
                 URL: https://issues.apache.org/jira/browse/GROOVY-8753
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation
    Affects Versions: 2.5.2
         Environment: Java 8u181, Ubuntu 18.04
            Reporter: Patric Bechtel


Following source compiles under 2.5.1 and 3.0alpha3, but not 2.5.2:
{code:java}
@groovy.transform.CompileStatic
class A {

   private List<String> fooNames = []

   public A(Collection<String> names) {
      names.each { fooNames << it }
   }

   public List<String> getFooNames() { fooNames }

}
{code}
error message is:
{noformat}
>>> a serious error occurred: BUG! exception in phase 'instruction selection' in
source unit 'A.groovy' Tried to overwrite existing meta data org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object:
org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable: this] property: ConstantExpression[fooNames]].
>>> stacktrace:
BUG! exception in phase 'instruction selection' in source unit 'A.groovy' Tried to overwrite
existing meta data org.codehaus.groovy.ast.expr.PropertyExpression@d9f41[object: org.codehaus.groovy.ast.expr.VariableExpression@d9f41[variable:
this] property: ConstantExpression[fooNames]].
    at org.codehaus.groovy.ast.ASTNode.setNodeMetaData(ASTNode.java:154)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkOrMarkPrivateAccess(StaticTypeCheckingVisitor.java:501)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.storeField(StaticTypeCheckingVisitor.java:1711)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1473)
    at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.existsProperty(StaticCompilationVisitor.java:522)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.existsProperty(StaticTypeCheckingVisitor.java:1381)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitPropertyExpressionSilent(StaticTypeCheckingVisitor.java:726)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.tryVariableExpressionAsProperty(StaticTypeCheckingVisitor.java:711)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitVariableExpression(StaticTypeCheckingVisitor.java:630)
    at org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:785)
    at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:227)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClosureExpression(StaticTypeCheckingVisitor.java:2286)
    at org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:49)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2596)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3286)
    at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:397)
    at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:122)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:88)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBlockStatement(StaticTypeCheckingVisitor.java:3628)
    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.transform.stc.StaticTypeCheckingVisitor.visitConstructorOrMethod(StaticTypeCheckingVisitor.java:2043)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructor(ClassCodeVisitorSupport.java:128)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitConstructor(StaticTypeCheckingVisitor.java:2393)
    at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1099)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
    at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClass(StaticTypeCheckingVisitor.java:387)
    at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitClass(StaticCompilationVisitor.java:182)
    at org.codehaus.groovy.transform.sc.StaticCompileTransformation.visit(StaticCompileTransformation.java:67)
    at org.codehaus.groovy.transform.ASTTransformationVisitor.visitClass(ASTTransformationVisitor.java:153)
    at org.codehaus.groovy.transform.ASTTransformationVisitor$2.call(ASTTransformationVisitor.java:197)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:631)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:609)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:586)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:565)
    at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:75)
    at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:243)
    at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:166)
    at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:206)
    at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:190)
    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.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:114)
    at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:136)
{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message