paulk_asert
05/18/2025, 10:41 AMpaulk_asert
05/18/2025, 10:44 AMpaulk_asert
05/18/2025, 11:54 AMjonnybot
05/30/2025, 7:03 PMVampire
06/04/2025, 9:53 AMsize
method to java.util.stream.Stream
?
And is there a reason NioExtensions#eachFile(Path, Closure)
does not have a @ClosureParams
annotation?paulk_asert
06/04/2025, 10:09 AMsize()
as an alias for count()
. It would have the same caveats as count
in terms of side-effects/infinite streams.Vampire
06/04/2025, 10:11 AMpaulk_asert
06/04/2025, 10:16 AMNioExtensions#eachFile(Path, Closure)
, it should have the same closure params as NioExtensions#eachFile(Path, FileType, Closure)
. I presume just an oversight.Vampire
06/04/2025, 10:36 AMFile
is the argument. ๐คทโโ๏ธ
https://youtrack.jetbrains.com/issue/IDEA-373956paulk_asert
06/04/2025, 10:38 AMpaulk_asert
06/04/2025, 10:42 AMpaulk_asert
06/04/2025, 10:43 AMVampire
06/04/2025, 11:44 AMpaulk_asert
06/04/2025, 1:37 PMVampire
06/04/2025, 1:48 PMpaulk_asert
06/04/2025, 1:50 PMbsdooby
06/13/2025, 6:59 AMbsdooby
06/13/2025, 7:00 AMpaulk_asert
06/13/2025, 8:22 AMbsdooby
06/13/2025, 8:32 AMrecord Vector2d(float x, float y) { }
bsdooby
06/13/2025, 8:32 AMbsdooby
06/13/2025, 8:33 AMbsdooby
06/13/2025, 8:33 AMpaulk_asert
06/13/2025, 8:41 AMpaulk_asert
06/13/2025, 8:54 AMbsdooby
06/13/2025, 9:48 AMjonnybot
06/16/2025, 9:50 PMcfValues['SpecialKey']*.name.collect {it.toUpperCase()}
Some context: cfValues
is a binding variable that I provide custom type information for via a ClassCodeExpressionTransformer
. In this case, the static type checker seems to know that cfValues['SpecialKey']
returns a value of the expected type which, in turn, has a name
property that is a String. Statements like:
cfValues['SpecialKey']*.name*.toUpperCase()
compiles just fine. But from Groovy 4.0.19 onward, the static type checker only seems to think that the it
Closure parameter is an Object
, not a String
. I've been poring over the diff and stepping through the debugger to figure out what changed, but I haven't been able to fathom it out. Does this ring a bell for anyone?paulk_asert
06/16/2025, 10:12 PMjonnybot
06/16/2025, 10:17 PMMariano
06/24/2025, 10:06 PMimplementation 'org.apache.groovy:groovy:4.0.27'
Also happens with Groovy 3.x, which is where I hit the issue (it's a Grails app).
Short example code:
import groovy.transform.CompileStatic
@CompileStatic
class SomeClass {
String desc
Integer int1
Long long1
@Override
String toString() {
return new StringBuilder('SomeClass{')
.append('desc=').append(desc)
.append(', int1=').append(int1)
.append(', long1=').append(long1)
.append('}')
.toString()
}
}
static void main(String[] args) {
println new SomeClass(desc: 'desc', int1: 1, long1: 2).toString() // works
println new SomeClass().toString() // causes NPE with @CompileStatic
}
Should I report this on JIRA? Though I don't have access to it and I'm short on time right now. Thanks!