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

Equality does not swallow errors #9560

Merged
merged 4 commits into from
Mar 29, 2024

Conversation

Akirathan
Copy link
Member

@Akirathan Akirathan commented Mar 27, 2024

Fixes #9283

Pull Request Description

42 == (Error.throw "foo") now correctly returns an Error rather than False

Important Notes

The error was in the wrong usage of the org.enso.interpreter.dsl.AcceptsError DSL annotation.

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,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@Akirathan Akirathan added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 27, 2024
@Akirathan Akirathan self-assigned this Mar 27, 2024
@@ -82,8 +81,7 @@ public static EqualsNode getUncached() {
* @param other the other object
* @return {@code true} if {@code self} and {@code that} seem equal
*/
public boolean execute(
VirtualFrame frame, @AcceptsError Object self, @AcceptsError Object other) {
public boolean execute(VirtualFrame frame, Object self, Object other) {
Copy link
Member Author

Choose a reason for hiding this comment

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

If a builtin method does not handle DataflowError itself, it should not annotate parameters with @AcceptsError. In other words, if @AcceptsError annotation is used, there should be a specialization that handles DataflowErrors.

@Akirathan Akirathan marked this pull request as ready for review March 27, 2024 12:15
@radeusgd
Copy link
Member

radeusgd commented Mar 27, 2024

Could you please also remove the workaround that was added because of the bug?

It should be enough to revert this commit: 32f876d

@Akirathan
Copy link
Member Author

Could you please also remove the workaround that was added because of the bug?

It should be enough to revert this commit: 32f876d

@radeusgd Reverted in 805785d

@Akirathan Akirathan added the CI: Ready to merge This PR is eligible for automatic merge label Mar 27, 2024
@enso-bot
Copy link

enso-bot bot commented Mar 27, 2024

Pavel Marek reports a new STANDUP for today (2024-03-27):

Progress: - Turns out I forgot to add the --disable-private-check cmd line option to our runner.

@mergify mergify bot merged commit 0b94493 into develop Mar 29, 2024
42 checks passed
@mergify mergify bot deleted the wip/akirathan/9283-equality-swallows-errors branch March 29, 2024 04:11
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. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Equality is 'swallowing' dataflow errors
3 participants