-
Notifications
You must be signed in to change notification settings - Fork 323
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
[Poc] Generate IR definitions - superclass approach #11770
base: develop
Are you sure you want to change the base?
Conversation
As of b8f6b8f all tests in An example of generated code for JExpression is: |
I think the generated code looks reasonably nice, but:
As a concept it is nice, but the real challenge is going to be the implementation of real |
I see one failure related to |
- Do not use asserts or any other exceptions. - Error is printed ony in the main processing loop.
Unapply & applyIn order to make necessary modifications in 0a1f5a8 demonstrates how a Java class I assume VSCode with Metals extension will also not be able to deduce that The question is: is this really worth it? Wouldn't it be better to just incrementally rewrite pattern matching in Scala that uses deconstruct to simpler variants that just matches on types? For example: val callArg = new JSpecified(true, None, lit)
callArg match {
case JSpecified(isSynthetic, _, _) =>
isSynthetic shouldEqual true
} Could be rewritten to callArg match {
case specified: JSpecified =>
specified.isSynthetic shouldEqual true
} without any behavioral changes. Moreover, the latter is OK in IDE. I would like to first create a PR that simplifies pattern matching, for TL;DR;Don't try to bend Java classes to look like Scala case classes. Just refactor deconstructing pattern matches in Scala to simpler variants. |
Alternative approach to #11267
Pull Request Description
The overall description is the same as in #11267, but this approach tries to generate super classes as suggested in https://github.com/enso-org/enso/pull/11267/files#r1869342527
Important Notes
An example of generated code for JExpression is:
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.