Christopher Smith created GROOVY-11265:
------------------------------------------

             Summary: Runtime rehydrate error for closure in interface default 
method
                 Key: GROOVY-11265
                 URL: https://issues.apache.org/jira/browse/GROOVY-11265
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 4.0.17
            Reporter: Christopher Smith


When using an interface default method (implemented in Groovy 4 as a trait) 
that returns an instance of a functional interface defined by a lambda, 
compilation succeeds but runtime invocation produces

{code}
groovy.lang.MissingMethodException: No signature of method: 
com.example.MyInterface$Trait$Helper$$Lambda$2132/0x0000000800e24c40.rehydrate()
 is applicable for argument types: (com.example.MyImplementation...) values: 
[com.example.MyImplementation@2a7087a8, ...]
        at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:72)
        at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:184)
        at com.example.MyInterface$Trait$Helper.curry(MyInterface.groovy:19)
        at com.example.MyImplementation.curry(MyImplementation.groovy)
{code}

I am attempting simplified replication and opening this ticket for an ID.



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

Reply via email to