Make sure you have jakarta.validation on the classpath
Then, the following code causes a build error
import jakarta.validation.constraints.NotNull;
public class TestSwitch {
public static void main(@NotNull Animal animal) {
switch(animal) {
case Cat c -> {}
}
}
record Cat() implements Animal {}
sealed interface Animal permits Cat {}
}
Tested under this environment:
OS & version: macOS 14.3
Eclipse IDE/Platform version (as shown in Help > About): 2023-12 (4.30.0)
Community
[x] I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
Steps to reproduce
Make sure you have
jakarta.validation
on the classpathThen, the following code causes a build error
Tested under this environment:
Community