Eric Milles created GROOVY-11225:
------------------------------------

             Summary: 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


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)

Reply via email to