groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-8247) AIOOBE in StaticTypeCheckingVisitor with SAM and explicit closure parameter
Date Thu, 14 Sep 2017 10:25:02 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-8247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Paul King resolved GROOVY-8247.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.4.13

Proposed PR merged. Thanks for spotting the issue.

> AIOOBE in StaticTypeCheckingVisitor with SAM and explicit closure parameter
> ---------------------------------------------------------------------------
>
>                 Key: GROOVY-8247
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8247
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation, Static Type Checker
>    Affects Versions: 2.4.10
>            Reporter: Daniil Ovchinnikov
>            Assignee: Paul King
>             Fix For: 2.4.13
>
>
> {code}
> def runnable(Runnable r) {
>     r.run()
> }
> @CompileStatic
> def foo() {
>     runnable { it -> // note explicit it
>         println it
>     }
> }
> foo()
> {code}
> {noformat}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> General error during instruction selection: 0
> java.lang.ArrayIndexOutOfBoundsException: 0
> 	at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.inferSAMType(StaticTypeCheckingVisitor.java:2424)
> 	at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.inferClosureParameterTypes(StaticTypeCheckingVisitor.java:2362)
> 	at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2326)
> 	at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3030)
> 	at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethodCallExpression(StaticCompilationVisitor.java:358)
> 	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
> 	at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:71)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:196)
> 	at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
> 	at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:37)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:166)
> 	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:104)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:115)
> 	at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitConstructorOrMethod(StaticTypeCheckingVisitor.java:1816)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:126)
> 	at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.startMethodInference(StaticTypeCheckingVisitor.java:2151)
> 	at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethod(StaticTypeCheckingVisitor.java:2110)
> 	at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitMethod(StaticCompilationVisitor.java:185)
> 	at org.codehaus.groovy.transform.sc.StaticCompileTransformation.visit(StaticCompileTransformation.java:76)
> 	at org.codehaus.groovy.transform.ASTTransformationVisitor.visitClass(ASTTransformationVisitor.java:134)
> 	at org.codehaus.groovy.transform.ASTTransformationVisitor$2.call(ASTTransformationVisitor.java:178)
> 	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
> 	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
> 	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
> 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
> 	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
> 	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
> 	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
> 	at groovy.lang.GroovyShell.run(GroovyShell.java:517)
> 	at groovy.lang.GroovyShell.run(GroovyShell.java:507)
> 	at groovy.ui.GroovyMain.processOnce(GroovyMain.java:653)
> 	at groovy.ui.GroovyMain.run(GroovyMain.java:384)
> 	at groovy.ui.GroovyMain.process(GroovyMain.java:370)
> 	at groovy.ui.GroovyMain.processArgs(GroovyMain.java:129)
> 	at groovy.ui.GroovyMain.main(GroovyMain.java:109)
> 	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:109)
> 	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message