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

Eric Milles updated GROOVY-10337:
---------------------------------
    Fix Version/s: 2.5.19

> STC rejects program on compiling constructor initialization with a wildcard 
> type
> --------------------------------------------------------------------------------
>
>                 Key: GROOVY-10337
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10337
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-beta-2, 2.5.19, 3.0.13
>
>
> I have the following program
> {code:java}
> class A<T1, T2> {
>   A(A<T2, ? extends T2> y) {}
> }
> class Test<T> {
>   void test() {
>     A<Number, T> x = new A<Number, T>((A<T, T>) null);
>   }
> }
> {code}
> h3. Actual behaviour
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> test.groovy: 7: [Static type checking] - Cannot call A#<init>(A<T, ? extends 
> java.lang.Object>) with arguments [A<T, T>]
>  @ line 7, column 22.
>        A<Number, T> x = new A<Number, T>((A<T, T>) null);
>                         ^
> 1 error
> {code}
> h3. Expected behaviour
> Compile successfully
> Tested against master (commit: 
> https://github.com/apache/groovy/commit/936983152430a7c030522126eb9e505c04cfb575)



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

Reply via email to