Skip to content

Commit b3057db

Browse files
committed
Require JDK 21, not 17
The NFA compiler switches over a sealed hierarchy of records. Pattern matching for switch was still a preview feature in 17 and was only finalised in 21, so the JDK 17 leg of CI could not compile it. Caught by the build rather than by a reader, which is what the matrix is for.
1 parent 85cb4b2 commit b3057db

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
java: ['17', '21', '24']
16+
# 21 is the floor: the NFA compiler switches over a sealed hierarchy, and
17+
# pattern matching for switch was still a preview feature in 17.
18+
java: ['21', '24']
1719
name: JDK ${{ matrix.java }}
1820
steps:
1921
- uses: actions/checkout@v4

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ step is never revisited.
118118

119119
## Build and test
120120

121-
Requires JDK 17 or newer. There is no Maven or Gradle to install.
121+
Requires JDK 21 or newer. The NFA compiler switches over a sealed hierarchy of records, and
122+
pattern matching for `switch` was only finalised in 21. There is no Maven or Gradle to install.
122123

123124
```bash
124125
javac -d out $(find src test -name '*.java')

0 commit comments

Comments
 (0)