-
Notifications
You must be signed in to change notification settings - Fork 326
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
Fix Runtime.assert
#8742
Fix Runtime.assert
#8742
Conversation
Without 798a882, the assertion error in
is printed as:
With 798a882 the assertion error is printed as:
As a user, I don't want to see internal |
There is InteropLibrary.getExceptionStackTrace method. You might find it useful. I used it in DataflowError speedup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think such a very specific hack (including logic for just one specific type of exception) is a good idea at all just to remove 4 frames from a specific stack trace.
Is it really such a problem that the stack trace contains additional 4 frames? The assertions are an advanced feature anyway, a user advanced enough to inspect stack traces will quickly see which frames are relevant to their problem.
I think there may be other places as well where we throw the panic from a helper and so it contains frames of that helper. Is it really a problem?
Moreover the hack only applies in one place, ignoring all the other places where we are manipulating stack traces - so the printed stack trace will be inconsistent depending on where we get it from.
@JaroslavTulach Unfortunately no. So let's just remove the ugly workaround, and live with a slightly longer stack traces for asserts. |
e4d8af8
to
3fc7cc8
Compare
@radeusgd Just to be sure, I have looked into the Graal graphs by running
And I can confirm that Truffle+Graal compiles |
It appears that I have accidentally used the assert wrongly, so the bug report #8741 might be invalid. But as this PR simplifies the implementation of |
Fixes #8741
Pull Request Description
Simplifies implementation of
Runtime.assert
.Important Notes
Runtime.assert_builtin
builtin method, replace it with pure enso code andRuntime.assertions_enabled
builtin.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.