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

Expression update contains full multi-value info #12195

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Jan 30, 2025

Pull Request Description

close #12153

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Jan 30, 2025
@4e6 4e6 self-assigned this Jan 30, 2025

if (publicTypes != null) {
final Type[] allTypes = typeOfNode.findAllTypesOrNull(value, true);
// Relies on the fact that allTypes appends extra types to the end of publicTypes.
Copy link
Member

@JaroslavTulach JaroslavTulach Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this safer:

@@ -119,7 +129,7 @@ object Runtime {
@named("expressionUpdate")
case class ExpressionUpdate(
expressionId: ExpressionId,
expressionTypes: Option[Vector[String]],
expressionType: Option[ExpressionType],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is (again) an incompatible change in the protocol. Shouldn't we rather start to be compatible in the absence of #7717? What about:

  • keeping expressionTypes unchanged
  • adding optional dispatchTypes with publicTypes = typeOfNode.findAllTypesOrNull(value, false);
  • note that when dispatchTypes are missing, then the first type of expressionTypes is dispatchable

* @param conversionType the available conversions
*/
case class ExpressionType(
visibleType: Vector[String],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I like the terminology:

  • maybe we use visible type somewhere
  • but we certainly never used conversion type!

The documentation is using following terms:

  • "has been cast to (the visible part)"
  • "hidden types .... can be cast to."

I understand that the current terminology isn't perfect. We can change it, but consistently. We shouldn't be inventing conversionType term in the protocol only. If we want new term, we should update (at least) docs as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expression update should contain full multi-value info
2 participants