You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2019/11/01 00:02:00 UTC
[jira] [Commented] (GROOVY-9189) AIC in default argument expression
of static method causes class cast exception
[ https://issues.apache.org/jira/browse/GROOVY-9189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16964464#comment-16964464 ]
Daniel Sun commented on GROOVY-9189:
------------------------------------
bq. meta version for 3.x for scheduling work (with new grammar) - don't leave as fix version
I will set the fix version to the latest released version
> 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.x
>
>
> 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.3.4#803005)