Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.8
-
None
Description
import groovy.transform.CompileStatic @CompileStatic class Client<T> { static String method() { return ({ try { return doSomething() } catch (IOException ioe) { println "IOException: ${ioe}" } catch (Exception e) { println "Exception: ${e}" } })() } private static <T> T doSomething() throws IOException { throw new IOException() return null } } Client.method()
Without the @CompileStatic, it outputs (as expected)
IOException: java.io.IOException
With the @CompileStatic, it outputs
Exception: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException