You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2023/04/24 14:28:00 UTC

[jira] [Created] (GROOVY-11023) SC: fix IncompatibleClassChangeError when closure direct targets extension method

Eric Milles created GROOVY-11023:
------------------------------------

             Summary: SC: fix IncompatibleClassChangeError when closure direct targets extension method
                 Key: GROOVY-11023
                 URL: https://issues.apache.org/jira/browse/GROOVY-11023
             Project: Groovy
          Issue Type: Bug
            Reporter: Eric Milles
            Assignee: Eric Milles


Consider the following:
{code:groovy}
@groovy.transform.CompileStatic
void test() {
    def c = { p, q = p.toString() -> '' + p + q }
    assert c('foo', 'bar') == 'foobar'
    assert c('foo') == 'foofoo'
}
test()
{code}

Default argument creates delegate method that does not have static compilation.  Running script throws {{java.lang.IncompatibleClassChangeError}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)