我想编写一个具有泛型方法的功能性非泛型接口的实现.实现需要内联闭包和简洁. 作为一个简化的例子@FunctionalInterface interface Fn {<R> R fn(R arg); } public class Scratch {Fn id = arg -> arg;//Fn nul = arg -> null;//Fn requiresNonNull = ... }这使/Scratch.java:5: error: incompatible types: invalid functional descriptor for lambda expressionFn id = arg -> arg;^method <R>(R)R in interface Fn is genericwhe...
昨天@headius / Charles Nutter在twitter上提出了一个非常有趣的想法:@danny_l Gafter made the same mistake; I don't mean a forked Java any more than Groovy is a fork. I want a "mostly Java" with closures. 或@danny_l / Danny Lagrouw的回复:@headius or could the BGGA prototype be "bolted on" any future version of Java? That might be useful 这也是我想要看到的.难道我们不能使用某种字节码预处理器来使BGGA原...