You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/06/18 10:35:01 UTC

[jira] [Commented] (GROOVY-4811) exception while compiling annotation type

    [ https://issues.apache.org/jira/browse/GROOVY-4811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14591476#comment-14591476 ] 

ASF GitHub Bot commented on GROOVY-4811:
----------------------------------------

GitHub user paulk-asert opened a pull request:

    https://github.com/apache/incubator-groovy/pull/41

    GROOVY-4811: exception while compiling annotation type

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paulk-asert/incubator-groovy groovy4811

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-groovy/pull/41.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #41
    
----
commit a7a5bc062640d66f42731761c2a59996276d47bb
Author: Paul King <pa...@asert.com.au>
Date:   2015-06-18T08:32:54Z

    GROOVY-4811: exception while compiling annotation type

----


> exception while compiling annotation type
> -----------------------------------------
>
>                 Key: GROOVY-4811
>                 URL: https://issues.apache.org/jira/browse/GROOVY-4811
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser-antlr
>    Affects Versions: 1.8-rc-3, 2.4.0-beta-3
>            Reporter: Maxim Medvedev
>
> {code}
> @interface Inter {
>   String[] bar() default "1"
> }
> {code}
> While compiling this annotation type the compiler throws
> java.lang.ClassCastException: org.codehaus.groovy.ast.expr.ConstantExpression cannot be cast to org.codehaus.groovy.ast.expr.ListExpression
> 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitAnnotationDefaultExpression(AsmClassGenerator.java:316)
> 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitAnnotationDefault(AsmClassGenerator.java:350)
> 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:259)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
> 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:366)
> 	at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1056)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
> 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:171)
> 	at org.codehaus.groovy.control.CompilationUnit$13.call(CompilationUnit.java:763)
> 	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:957)
> 	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:542)
> 	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:520)
> 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
> 	at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:43)
> 	at org.jetbrains.groovy.compiler.rt.GroovycRunner.main(GroovycRunner.java:128)
> 	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:597)
> 	at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:75)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)