You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/10/07 15:05:00 UTC

[jira] [Assigned] (GROOVY-10283) Cannot assign type parameter whose bound is a parameterized type that takes a wildcard

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

Eric Milles reassigned GROOVY-10283:
------------------------------------

    Assignee: Eric Milles

> Cannot assign type parameter whose bound is a parameterized type that takes a wildcard
> --------------------------------------------------------------------------------------
>
>                 Key: GROOVY-10283
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10283
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Major
>
> I have the following program
> {code:java}
> class A<T1, T2> {}
> class B<T1 extends Number, T2 extends A<C, ? extends T1>> {
>   T2 f;
>   B(T2 f) {
>     this.f  = f;
>   }
> }
> class C {}
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> test.groovy: 7: [Static type checking] - Cannot assign value of type A<C, ? extends java.lang.Number<T1 extends java.lang.Number>> to variable of type T2
>  @ line 7, column 15.
>        this.f  = f;
>                  ^
> 1 error
> {code}
> h3. Expected behavior
> Compile successfully
> Tested against master



--
This message was sent by Atlassian Jira
(v8.3.4#803005)