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 2023/12/22 11:39:01 UTC

[jira] [Closed] (GROOVY-11225) shouldFail return type

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

Paul King closed GROOVY-11225.
------------------------------

> shouldFail return type
> ----------------------
>
>                 Key: GROOVY-11225
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11225
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-test
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-3
>
>
> The declaration of {{GroovyAssert}} shouldFail and shouldFailWithCause could be improved to return the given type.  For example:
> {code:java}
>     public static Throwable shouldFail(Class clazz, Closure code) {
>       // ...
>     }
> {code}
> could be written as:
> {code:java}
>     public static <T extends Throwable> T shouldFail(Class<T> type, Closure code) {
>     }
> {code}
> This should not change the erasure type of the method, so it should not require a bridge method to maintain binary compatibility.



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