Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in JDT Core during AST creation when using exhaustive switch statement and @NotNull #186

Open
1 task done
ashley-taylor opened this issue Feb 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ashley-taylor
Copy link

ashley-taylor commented Feb 27, 2024

Steps to reproduce

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

  • 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.
@ashley-taylor ashley-taylor added the bug Something isn't working label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant