eclipse-platform / .github

Common contribution content for eclipse-platform repositories
https://www.eclipse.org/eclipse/
4 stars 10 forks source link

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

Closed ashley-taylor closed 2 weeks ago

ashley-taylor commented 4 months ago

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:

Community

jukzi commented 2 weeks ago

not platform. please create a copy at https://github.com/eclipse-jdt/eclipse.jdt.core/issues/