Skip to content

ECJ doesn't report expected error about domination #4979

@jarthana

Description

@jarthana

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions