You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2019/11/24 02:46:01 UTC
[jira] [Closed] (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:all-tabpanel ]
Paul King closed GROOVY-9189.
-----------------------------
> 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
>
>
> 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)