-
Notifications
You must be signed in to change notification settings - Fork 53
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
false STRING assignment leads to panicked #1168
Comments
This seems to be a diagnostics severity problem. Invalid assignment should be an error, not a warning - then we also would not enter codegen and no panic would be happening.
|
here is about the panicked text, not the error itself
yes |
Reopening because we should not reach a panic state. |
I still think we should not panic but exist gracefully although this is a bigger topic. Should we make some errors non-changeable like the E37 or the one for references? This used to be the case with the critical errors |
Big fan of this, any crucial error code should have an immutable severity imo |
how would the user be able to recognize which error codes are configurable and which are not? |
this is a very good point @tisis2 |
The way rust does this is they have 2 types of errors, hard errors that cannot be changed, these are the E ones, and then named errors that can be changed in severity. These are ones things like deprecation warnings or clippy issues, they call them lints. https://rustc-dev-guide.rust-lang.org/diagnostics.html |
I would say if an error can lead to a panic, it's non configurable. Things like this error here or the reference error. |
But how do we show this? Do we make these errors have different codes? And give out an error if the error_config.json ignores one of them? We could introduce a "critical" section to the registry, and on loading a custom error config, if any of the critical errors gets a reduced severity we through an error and don't compile. |
maybe something like that... we could also reflect it in the error id and differ between CRIT... and E... for example. but to be honest, i think currently all this is nice to have... if a user changes an error to a warning and gets a panic after that step, the user might recognize that it is about the configuration that was changed... |
we can make a template where only at certain error codes can the severity be changed for example:
|
the following code
will generate the following error with panicked:
mainProg.st:5:1:{5:1-5:9}: warning[E037]: Invalid assignment: cannot assign 'DINT' to 'STRING'
thread '' panicked at src\codegen\llvm_typesystem.rs:187:18:
internal error: entered unreachable code: Cannot cast integer value to STRING
note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceThe text was updated successfully, but these errors were encountered: