-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1.8
-
Fix Version/s: 2.2.1
-
Component/s: Static compilation
-
Labels:None
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