groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <>
Subject About the progress of supporting native lambda
Date Wed, 17 Jan 2018 08:10:20 GMT
Hi all,

     Currently Groovy 3 supports some common scenarios of native lambda[1]
in the static compilation mode. Groovy's native lambda conforms to the
semantic of Java's Lambda(e.g. `this` references the instance of the
enclosing  class).

     Since native lambda relies on static analysis, if static analysis
fails[2][3], native lambda can not been compiled either. We should fix the
issues(e.g.  GROOVY-8445 <> 

     In addition, the following issue[4] should be fixed too. I think I have
not found a correct way to use ClassNode instance, any help is appreciated!
A transform used a generics containing ClassNode Test1 for the method public
static int doCall(Test1 __this, java.lang.Integer e)  { ... } directly. You
are not supposed to do this. Please create a new ClassNode referring to the
old ClassNode and use the new ClassNode instead of the old one. Otherwise
the compiler will create wrong descriptors and a potential
NullPointerException in TypeResolver in the OpenJDK. If this is not your own
doing, please report this bug to the writer of the transform.

     Next I plan to support callable native lambda(e.g. `(e -> { println e
})('Hello, world!')`).

     Here is the url of native-lambda branch of Groovy 3:



Sent from:

View raw message