/* Example what happened when you use backslash in Slashy string (https://groovy-lang.org/syntax.html#_slashy_string) Note: there is a note that you are not supposed to do that in https://groovy-lang.org/syntax.html#_special_cases "A consequence of slash escaping is that a slashy string can’t end with a backslash" */ import groovy.io.* // def dir = new File(/C:\Users/) // WORKS (removed last slash) // def dir = new File("C:\\Users\\") // WORKS // def dir = new File("C:\\Users") // WORKS // from statement below any GString with interpolation or comments doesn't work (ie. cannot be compiled) def dir = new File(/C:\Users\/) def expressionWorks = 1+1 println expressionWorks println "GString without interpolation works" println 'String works' dir.eachFile({ file -> "expression below is not working, remove it (commenting doesn't work either) and it starts to work" println "${file}" "working expressions" println file println "file" })