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/05/01 15:01:00 UTC

[jira] [Resolved] (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 ]

Eric Milles resolved GROOVY-10267.
----------------------------------
    Fix Version/s: 5.0.0-alpha-1
                   2.5.17
                   3.0.11
                   4.0.2
       Resolution: Fixed

https://github.com/apache/groovy/commit/07a5cd4527a477677c13723cd24fa95bcda72c7e

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