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

Trading shouldNotReachHere() for an abstract method #9312

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Mar 7, 2024

Pull Request Description

Avoiding shouldNotReachHere() in favor of less fatal exceptions/constructs.

Checklist

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

  • All code follows the
    Java,
    style guides.
  • All code has been tested:
    • Unit tests continue to pass

@@ -90,7 +90,8 @@ Object invokeWithWarnings(
Warning[] extracted = warnings.getWarnings(warning, null, false);
return WithWarnings.wrap(EnsoContext.get(this), result, extracted);
} catch (UnsupportedMessageException e) {
throw CompilerDirectives.shouldNotReachHere(e);
Copy link
Member Author

Choose a reason for hiding this comment

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

UnsupportedMessageException may happen. We are calling to unknown implementation, unknown language and we cannot assume how it is implemented. As such it is safer to not panic on JVM level but propagate such state as a regular Enso interpreter panic.

eb5a030 does that for whole engine/runtime project.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 7, 2024
@JaroslavTulach JaroslavTulach added CI: Ready to merge This PR is eligible for automatic merge CI: Clean build required CI runners will be cleaned before and after this PR is built. labels Mar 7, 2024
@mergify mergify bot merged commit 7e498a0 into develop Mar 7, 2024
35 of 38 checks passed
@mergify mergify bot deleted the wip/jtulach/LessShouldNotReachHere branch March 7, 2024 13:02
@enso-bot
Copy link

enso-bot bot commented Mar 8, 2024

Jaroslav Tulach reports a new STANDUP for yesterday (2024-03-07):

Progress: - PR to eliminate shouldNotReachHere: #9312

Next Day: 50% of work

Discord
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Discord
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler CI: Clean build required CI runners will be cleaned before and after this PR is built. 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.

3 participants