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

[23] ECJ rejects boolean type pattern with default case #3128

Open
jarthana opened this issue Oct 21, 2024 · 1 comment
Open

[23] ECJ rejects boolean type pattern with default case #3128

jarthana opened this issue Oct 21, 2024 · 1 comment
Assignees

Comments

@jarthana
Copy link
Member

This is a fallout after issue #2916 was fixed, I think.

Here's the relevant code that Javac accepts but we reject:

class X {
	public void foo(Boolean boxed) {
		switch (boxed) {
			case boolean b -> {}
			default -> {}
		}
	}
}

The reported error is: Switch cannot have both boolean values and a default label

This is because we are using the same Exhaustive flag for total pattern as well as true+false. Should we differentiate between the two conditions?

@stephan-herrmann

@srikanth-sankaran
Copy link
Contributor

@stephan-herrmann - thanks for taking a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants