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 2022/07/23 16:23:00 UTC

[jira] [Updated] (GROOVY-10364) STC does not type check method call when using bounded type parameter as a type argument

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

Eric Milles updated GROOVY-10364:
---------------------------------
    Fix Version/s:     (was: 5.0.0-alpha-1)

> STC does not type check method call when using bounded type parameter as a type argument
> ----------------------------------------------------------------------------------------
>
>                 Key: GROOVY-10364
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10364
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 3.0.11, 4.0.3
>
>
> I have the following program
> {code:java}
> class A<T> {
>   void m(B<T> x, T y) {}
> }
> class B<T> {}
> class Test<X, Y extends X> {
>   void m() {
>     A<Y> x = new A<Y>();
>     x.m(new B<Y>(), (Y) null);
>   }
> }
> {code}
> h3. Actual behaviour
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> test.groovy: 11: [Static type checking] - Cannot call A#m(B<Y extends X>, Y) with arguments [B<Y>, Y]
>  @ line 11, column 5.
>        x.m(new B<Y>(), (Y) null);
>        ^
> 1 error
> {code}
> h3. Expected behaviour
> Compile successfully
> Tested against master.



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