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

[Records] ECJ compiles arity mismatched canonical constructor #3663

Open
srikanth-sankaran opened this issue Feb 3, 2025 · 0 comments
Open
Assignees

Comments

@srikanth-sankaran
Copy link
Contributor

srikanth-sankaran commented Feb 3, 2025

Found by JLS review and black-box testing:

This program compiles with ECJ but javac rejects it with: error: invalid canonical constructor in record R (type and arity must match that of the corresponding record component)

I believe javac behavior is correct since we won't be able to invoke the explicitly declared constructor with multiple int arguments.

record R(int ... x) {
	
	R(int [] x) {
		this.x = x;
	}
	
}
@srikanth-sankaran srikanth-sankaran self-assigned this Feb 3, 2025
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

1 participant