I'm having a problem converting gradle scripts to kotlin regarding of closure: I have this method signature in Groovy:
static copyAndRenameChildFiles(File sourceDir, Closure<String> filenameTransform)
and I'm trying to call from a kotlin script, I tried to use `closureOf`like this:
val copyDir = FileUtils.copyAndRenameChildFiles(svgSrcDir, closureOf<String> { this.replace("-", "_") })
but I'm getting the error:
Type mismatch: inferred type is Closure<Any?> but Closure<String!>! was expected
the original call on Groovy was:
File copyDir = FileUtils.copyAndRenameChildFiles(svgSrcDir, { String filename -> filename.replace("-", "_") })