Daniel Huss created GROOVY-8027:
-----------------------------------
Summary: Unexpected ClassCastException in multi-catch including
java.lang.Error
Key: GROOVY-8027
URL: https://issues.apache.org/jira/browse/GROOVY-8027
Project: Groovy
Issue Type: Bug
Affects Versions: 2.4.7
Environment: Java 1.8.0_66
Reporter: Daniel Huss
{code}
import groovy.transform.CompileStatic
@CompileStatic
class Example {
public static void main( String[] args ) {
try {
throw new RuntimeException( "ok" )
} catch ( RuntimeException | Error e ) {
println "${e.class.simpleName} : ${e.message}"
}
}
}
{code}
Expected output: {{RuntimeException : ok}}
Actual output: {{Exception in thread "main" java.lang.ClassCastException:
java.lang.RuntimeException cannot be cast to java.lang.Error}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)