This code does not compile with Gradle 7.6.3:
def x = switch (true) {
case true -> "hello"
case false -> "hi"
}
Unexpected input: 'switch' @ line 81, column 9.
def x = switch (true) {
^
but it’s perfectly valid Groovy code according to the docs: The Apache Groovy programming language - Semantics