You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/07/24 12:20:00 UTC

[jira] [Closed] (GROOVY-10267) STC reports wrong message when encoutering wildcard types

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

Paul King closed GROOVY-10267.
------------------------------

> STC reports wrong message when encoutering wildcard types
> ---------------------------------------------------------
>
>                 Key: GROOVY-10267
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10267
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Thodoris Sotiropoulos
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 2.5.17, 3.0.11, 4.0.2
>
>
> I have the following program
> {code:java}
> class A<T> {
> }
> class B {
>   A<? extends Object> test() {
>     return test2();
>   }
>   A<? extends Object> test2() {
>     return null;
>   }
> }
> {code}
> h3. Actual behaviour
> {code:java}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> test.groovy: 6: [Static type checking] - Incompatible generic argument types. Cannot assign A<?> to: A<? extends java.lang.Object>
>  @ line 6, column 12.
>        return test2();
>               ^1 error
> {code}
> h3. Expected behaviour
> Compile successfully
> Tested against master



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