[
https://issues.apache.org/jira/browse/GROOVY-10995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Marat Kamalov updated GROOVY-10995:
-----------------------------------
Summary: Classes is compiled in Groovy 3 and Java but fails in Groovy 4
(was: Wrong class compilation validation)
> Classes is compiled in Groovy 3 and Java but fails in Groovy 4
> --------------------------------------------------------------
>
> Key: GROOVY-10995
> URL: https://issues.apache.org/jira/browse/GROOVY-10995
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 4.0.10
> Reporter: Marat Kamalov
> Priority: Major
>
> We use Groovy 3. And I tried to migrate the existing application to use
> Groovy 4.
> I have a compilation issue in the code and the same behavior in IntelliJ
> IDEA, because it uses Groovy 4 syntax by default.
> What I have:
> {code:java}
> // A simple interface with generic parameter
> interface MyInterface<T> {
> } {code}
> {code:java}
> // A simple annotation that expects an MyInterface implemenations
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.METHOD)
> @interface MyAnnotation {
> Class<? extends MyInterface<?>> value()
> } {code}
> {code:java}
> //A class that implements MyInterface and ignores type raw type using warnings
> public class MyClass implements MyInterface {
> }
> {code}
> {code:java}
> // A method that uses MyAnnotation with MyClass parameter
> @MyAnnotation(value = com.example.MyClass)
> static void main(String[] args) {
> }{code}
> This code compiles in Groovy 3 and compiles in Java but fails to compile in
> Groovy 4.0.10
> The code starts to compile in Groovy 4 If I change MyClass implementation to:
> {code:java}
> public class MyClass implements MyInterface<Object> {
> } {code}
> I think it is a bug, please, validate and fix it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)