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

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

paulk-asert merged PR #1890:
URL: https://github.com/apache/groovy/pull/1890




> Annotation collection isn't properly handling enum annotation attribute values
> ------------------------------------------------------------------------------
>
>                 Key: GROOVY-11062
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11062
>             Project: Groovy
>          Issue Type: Bug
>          Components: class generator, Stub generator / Joint compiler
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> The easiest way to reproduce is to change the definition of `Immutable`.
>  Change the line:
> {code}
> @TupleConstructor(defaults = false)
> {code}
> to:
> {code}
> @TupleConstructor(defaultsMode = DefaultsMode.OFF)
> {code}
> The first error is to do with stub generation:
> {noformat}
> subprojects/groovy-macro/build/tmp/compileGroovy/groovy-java-stubs/org/codehaus/groovy/macro/matcher/MatchingConstraints.java:3:
>  error: incompatible types: String cannot be converted to DefaultsMode
> @groovy.transform.CompileStatic() 
> @groovy.transform.ToString(includeSuperProperties=true, cache=true) 
> @groovy.transform.EqualsAndHashCode(cache=true) 
> @groovy.transform.ImmutableBase() @groovy.transform.Final() 
> @groovy.transform.ImmutableOptions(knownImmutableClasses={org.codehaus.groovy.macro.matcher.internal.ConstraintPredicate.class})
>  
> @groovy.transform.PropertyOptions(propertyHandler=groovy.transform.options.ImmutablePropertyHandler.class)
>  @groovy.transform.TupleConstructor(defaultsMode="OFF") 
> @groovy.transform.MapConstructor(noArg=true, includeSuperProperties=true, 
> includeFields=true) @groovy.transform.KnownImmutable() public class 
> MatchingConstraints
>                                                                               
>                                                                               
>                                                                               
>                                                                               
>                                                 
>               ^
> 1 error
> startup failed:
> Compilation failed; see the compiler error output for details.
> {noformat}
> Once that is fixed, the next error surfaces which is once the 
> `compileTestGroovy` task is executed:
> {noformat}
> General error during instruction selection: Cannot generate bytecode for 
> constant: OFF of type: groovy.transform.DefaultsMode
> org.codehaus.groovy.classgen.ClassGeneratorException: Cannot generate 
> bytecode for constant: OFF of type: groovy.transform.DefaultsMode
>         at 
> org.codehaus.groovy.classgen.asm.OperandStack.pushConstant(OperandStack.java:513)
>         at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitConstantExpression(AsmClassGenerator.java:897)
>         at 
> org.codehaus.groovy.ast.expr.ConstantExpression.visit(ConstantExpression.java:82)
>         at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitMapExpression(AsmClassGenerator.java:1615)
>         at 
> org.codehaus.groovy.ast.expr.MapExpression.visit(MapExpression.java:54)
> ...
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to