eclipse-jdt / eclipse-jdt/eclipse.jdt.core

ECJ doesn't report expected error about domination

Open
#4,979 17 comments 0 reactions 2 assignees Claimed by @stephan-herrmann View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

Here's the testcase:

```
public class X {
public int foo(Character c) {
int result = 0;
switch (c) {
case Character c1 -> {
result = c1;
break;
}
case 0 -> { // Same goes for case (int) 0
result = 0;
break;
}
}
return result;
}
}
```

Javac reports this -` error: this case label is dominated by a preceding case label` but we allow this.

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.