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/02/03 22:33:00 UTC

[jira] [Closed] (GROOVY-10256) STC: no error for incompatible type bounds on return value

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

Paul King closed GROOVY-10256.
------------------------------

> STC: no error for incompatible type bounds on return value
> ----------------------------------------------------------
>
>                 Key: GROOVY-10256
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10256
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 4.0.0-beta-1
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-beta-2
>
>
> Consider the following:
> {code:groovy}
> def <T extends CharSequence> T chars() {
>   "foo"
> }
> @groovy.transform.TypeChecked
> List test() {
>   chars()
> }
> {code}
> The return type extends {{CharSequence}}, which is incompatible with {{List}}.  No STC error is produced.  This is a follow up from GROOVY-7316.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)