eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

[19] No quickfix offered when a switch case is reported to have both unconditional pattern and default label

Open
#283 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
22h 47m
Merged PRs (30d)
28

Description

The following code, when preview is enabled, is reported for an error:

```
int res = switch(r) {
case Rectangle3 r1 -> {
yield 1;
}
default -> 0;
};
```

The error reported is : `Switch case cannot have both unconditional pattern and default label`
However, there's no quickfix provided to remove the default label. It would be helpful for the user to provide one.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.