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 <https://issues.apache.org/jira/browse/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: https://github.com/apache/groovy/tree/native-lambda Cheers, Daniel.Sun [1] https://github.com/apache/groovy/blob/62c835b4e42071fb167934bb87176389d4cd999f/src/test/groovy/transform/stc/LambdaTest.groovy [2] https://github.com/apache/groovy/blob/62c835b4e42071fb167934bb87176389d4cd999f/src/test/groovy/transform/stc/LambdaTest.groovy#L58 [3] https://github.com/apache/groovy/blob/62c835b4e42071fb167934bb87176389d4cd999f/src/test/groovy/transform/stc/LambdaTest.groovy#L139 [4] https://github.com/apache/groovy/blob/6bf63025ea0478f92ae7075990e90f435cf656fc/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java#L267-L271 -- Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html