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

Eric Milles resolved GROOVY-10364.
----------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

https://github.com/apache/groovy/commit/8b44c0af6f167892a239804d99149a5f6323d984

> 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: 5.0.0-alpha-1
>
>
> 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.7#820007)

Reply via email to