-
Bug
-
Resolution: Duplicate
-
Major
A switch expression like this in a groovy DSL pipeline code.
javaVersion = switch (jdkVersion) {
case "JDK8", null -> "OpenJDK 8"
case "JDK11" -> "OpenJDK 11"
case "JDK17" -> "OpenJDK 17"
{{default -> { error("The JDK version ${jdkVersion} is unknown. Expected JDK8 (default), JDK11 or JDK17."); "" }}}
}
produces a compile error similar to this.
WorkflowScript: 96: unexpected token: switch @ line 96, column 29.
Jenkins 2.375.1
- duplicates
-
JENKINS-68690 Upgrade Groovy from 3.0.x to 4.0.x
- Open