Tag: 编译静态

Groovy staic打字的这个漏洞有机会得到修复

当我运行以下Groovy代码片段时,按预期显示“,a,b,c”: @CompileStatic public static void main(String[] args) { def inList = ["a", "b", "c"] def outList = inList.inject("", { a, b -> a + "," + b }) println(outList) } 现在我将第一个参数从一个空字符串中注入到数字0: @CompileStatic public static void main(String[] args) { def inList = ["a", "b", "c"] def outList = inList.inject(0, { a, b -> a + "," […]