8000 [Records] ECJ compiles arity mismatched canonical constructor · Issue #3663 · eclipse-jdt/eclipse.jdt.core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Records] ECJ compiles arity mismatched canonical constructor #3663

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

Closed
srikanth-sankaran opened this issue Feb 3, 2025 · 0 comments · Fixed by #3993
Closed

[Records] ECJ compiles arity mismatched canonical constructor #3663

srikanth-sankaran opened this issue Feb 3, 2025 · 0 comments · Fixed by #3993
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
srikanth-sankaran added a commit to srikanth-sankaran/eclipse.jdt.core that referenced this issue May 9, 2025
complained about by ECJ

* Fixes eclipse-jdt#3957

[Records] ECJ compiles arity mismatched canonical constructor

* Fixes eclipse-jdt#3663
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

Successfully merging a pull request may close this issue.

1 participant
0