[
https://issues.apache.org/jira/browse/GROOVY-9189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-9189:
--------------------------------
Fix Version/s: 2.5.16
> AIC in default argument expression of static method causes class cast
> exception
> -------------------------------------------------------------------------------
>
> Key: GROOVY-9189
> URL: https://issues.apache.org/jira/browse/GROOVY-9189
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Priority: Major
> Fix For: 3.0.0-rc-1, 2.5.16
>
>
> Consider the following:
> {code:groovy}
> class Main {
> static main(args) {
> this.meth()
> }
> static void meth(Runnable action = new Runnable() {
> @Override void run() {
> print 'works'
> }
> }) {
> action.run()
> }
> }
> {code}
> Compiling and executing this class results in
> {{org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast
> object 'class Main' with class 'java.lang.Class' to class 'Main'}}.
> See also GROOVY-6777, GROOVY-6809, GROOVY-7609 and GROOVY-9168
--
This message was sent by Atlassian Jira
(v8.20.1#820001)