> For code like: > > enum E {A {}, B {} } > Object o = E.A; > switch (o) { > case E.A -> System.err.println(o); > default -> System.err.println("default"); > } > > > The result is `default`, not `A`, due to incorrect classes being compared. > Thanks for @liach for noting the solution here: > https://github.com/openjdk/jdk/pull/16489#discussion_r1381411165
Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Adding tests as suggested. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16499/files - new: https://git.openjdk.org/jdk/pull/16499/files/5f40a8eb..cbc9cb56 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16499&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16499&range=01-02 Stats: 12 lines in 2 files changed: 10 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/16499.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16499/head:pull/16499 PR: https://git.openjdk.org/jdk/pull/16499