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
Faulty Code: compiler honor failBlock #13261
Faulty Code: compiler honor failBlock #13261
Conversation
e832f68
to
74e50cd
Compare
Question:
Do we have to distinguish them? I was at some point wondering if exactly the eval methods could not default to compile a faulty DoIt Method and then rely only on runtime error notification. As eval implies that the compilation is always executed, would it really matter if the exeception is raised before or during evaluation? |
This is a good question. I think it's important if the client (e.g. a profiler tool) wants to report back errors to the user that inputted the source. |
Error handling is always a complex matter. With this PR there is an additional solution. I'm not a fan of adding an alternative API to do somewhat the same thing. Currently, there is:
I think the last one covers use cases the two other cannot cover by design. |
failBlock in OpalCompiler are used with requestor to exit the call.
Without a requestor, they were silently ignored.
The PR promote failBlock to general usage.
Having a reliable failBlock is important because it's the only way for
evaluate
to distinguish compile-time errors from runtime errors. Exceptions are too broad and cannot distinguish them.Tests are also added
This PR also fix a bug introduced in a previous PR with the undeclared variable GUI reparation
It required a change in the internal API parse->checkNotice