-
Notifications
You must be signed in to change notification settings - Fork 317
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
Allow methods to inspect warnings attached to self
, if requested
#6222
Comments
I believe @hubertp is already working on such a functionality. See: |
This issue is a follow-up to #6027, as noted in a comment in the PR attached to it. |
Having a custom annotation to indicate that we should leave the warnings alone was one idea that I proposed when attempting to fix the original PR/issue. It's unfortunately much more involving because a lot of places assume that warnings do not wrap A better solution would be to support warnings natively, something that @JaroslavTulach started with a draft PR in GraalVM. This would be a more stable and performance-oriented solution. It will also take longer to get in that change to the official release. |
Cool! Is there a link to the draft PR so one can follow its progress?
This may be an issue, since I think we will need to be able to provide the ability to 'avoid writing if there are warnings attached' relatively soon - but that is a venue that @jdunkerley will know best I suppose. |
Please note that "invoking methods on self with warnings" is basically doing the same thing as https://github.com/orgs/enso-org/discussions/6216 - e.g. the invoking a method with completely different
|
Well, I'd say this applies to the current PR #6027 - as indeed it delegates each call of That's exactly why I don't like that solution and I'm advocating for another one in this task. With this task, we wouldn't be modifying the dispatch mechanism - every invocation of So yeah, this is another argument for this task :) (although the main argument is still that we need it to implement the 'do not run |
Related to #6070. |
@Akirathan Is it? I think that #6070 is about builtin methods and this issue is mostly aimed at methods written in Enso, so these seem to be separate things. |
Oh, right, sorry - yes, #6070 is only about stripping warnings from |
As noted in #6176:
We should have some way to mark any method to be able to have special handling of attached warnings.
The idea is following:
We want to keep the current behaviour for now, so that
b.method_1
would still print[]
and the warnings are passed on to the result, but from inside of the invocation they are not seen.But for specially marked functions (be it with an
@annotation
or some other special marking (maybe we could reuse the~
sign which has no sensible meaning onself
currently? just an idea)) we want to be able to 'see' all warnings that were attached to a value from where it was being invoked. So inb.method_2
we'd expect it to print the warningWARN
.This will allow us to implement stuff like #6176 in pure Enso without special handling. More importantly, it will allow us to implement the warning checks needed for the Write operations.
The text was updated successfully, but these errors were encountered: