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

Ensure EnsoMultiValue returns some Meta.type_of #11480

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Nov 4, 2024

Pull Request Description

Discovered when discussing #11366 - sometimes (when also representing a number) a multi value panics on computing Meta.type_of.

Checklist

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

  • All code follows the
    Java,
  • Unit tests have been written where possible.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Nov 4, 2024
@JaroslavTulach JaroslavTulach self-assigned this Nov 4, 2024
@JaroslavTulach
Copy link
Member Author

Previously the following was broken:

problem with b2 and node1

With this PR the first type (e.g. Text in case of Text & Integer) is returned.

Copy link
Member

@Akirathan Akirathan left a comment

Choose a reason for hiding this comment

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

Approving. But it seems to me that there may be a test missing.


group_builder.specify "multi_value_as_text_int" <|
v = R.V "hi" 3 . as_text_int
Meta.type_of v . should_equal Text
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't you also add test for Meta.type_of v . should_equal Integer ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I cannot right now, as the type doesn't equal Integer. Currently only the first type is used by type_of. That's likely to change with the work on

For now, the test checks just the first type.

@JaroslavTulach JaroslavTulach merged commit dd107e0 into develop Nov 4, 2024
42 checks passed
@JaroslavTulach JaroslavTulach deleted the wip/jtulach/MetaOfMultiValue11366 branch November 4, 2024 19:47
@enso-bot
Copy link

enso-bot bot commented Nov 5, 2024

Jaroslav Tulach reports a new STANDUP for yesterday (2024-11-04):

Progress: .

Next Day: Planning & fixes

GitHub
Using Enso Type Classes in the IDE There is a blueprint describing how to write Type Classes in Enso. Can such type classes be used in the IDE? there is nothing special on the actual type class its...

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.

4 participants